Skip to content

Fixed crash during triple tap on empty textfield with usingNativeTextInput flag enabled#2910

Merged
Vladimir Mazunin (mazunin-v-jb) merged 2 commits into
jb-mainfrom
v.mazunin/fix-niti-crash-triple-tap
Mar 27, 2026
Merged

Fixed crash during triple tap on empty textfield with usingNativeTextInput flag enabled#2910
Vladimir Mazunin (mazunin-v-jb) merged 2 commits into
jb-mainfrom
v.mazunin/fix-niti-crash-triple-tap

Conversation

@mazunin-v-jb

@mazunin-v-jb Vladimir Mazunin (mazunin-v-jb) commented Mar 24, 2026

Copy link
Copy Markdown

Fixed the crash during triple tap on empty textfield with usingNativeTextInput flag enabled by changing non-optional cast of UITextRange to TextRange to optional

Fixes:
CMP-9881 [ios].niti. Crash during triple tap on empty line with feature flag enabled

Testing

This should be tested by QA

Release Notes

Fixes - iOS

  • (prerelease fix) Fix crash during triple tap on empty textfield with usingNativeTextInput flag enabled

Comment on lines +509 to +511
val fallback = IntermediateTextPosition(0)
PlatformTextLayoutDirection(farthestInDirection)?.let { direction ->
input?.positionWithinRange(range.toTextRange(), direction)?.let {
val textRange = range.toTextRange() ?: return fallback

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
val fallback = IntermediateTextPosition(0)
PlatformTextLayoutDirection(farthestInDirection)?.let { direction ->
input?.positionWithinRange(range.toTextRange(), direction)?.let {
val textRange = range.toTextRange() ?: return fallback
val fallback = IntermediateTextPosition(0)
val textRange = range.toTextRange() ?: return fallback
PlatformTextLayoutDirection(farthestInDirection)?.let { direction ->

@mazunin-v-jb Vladimir Mazunin (mazunin-v-jb) force-pushed the v.mazunin/fix-niti-crash-triple-tap branch from 6f3f34e to a5c1fa9 Compare March 26, 2026 16:21
@mazunin-v-jb Vladimir Mazunin (mazunin-v-jb) merged commit 8655f8a into jb-main Mar 27, 2026
27 of 28 checks passed
@mazunin-v-jb Vladimir Mazunin (mazunin-v-jb) deleted the v.mazunin/fix-niti-crash-triple-tap branch March 27, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants