Repository navigation
Support composing text for Native Text Input - #3569
Andrei Salavei (ASalavei) wants to merge 8 commits into
Conversation
# Conflicts: # compose/ui/ui/src/iosMain/kotlin/androidx/compose/ui/window/NativeTextInputView.ios.kt
| edit(requireUpdateView = false) { | ||
| setComposingText(markedText, 1) | ||
| } | ||
| markedText ?: return |
There was a problem hiding this comment.
if markedText == null shouldn't we also call unmarkText ?
There was a problem hiding this comment.
it should be markedText ?: "" instead - updated.
| val range = currentTextFieldValue?.composition ?: currentTextFieldValue?.selection ?: return | ||
| edit { | ||
| setComposingText(markedText, 1) | ||
| val newSelection = TextRange(start = range.start + selectedRange.start, end = range.start + selectedRange.end) |
There was a problem hiding this comment.
Should we use range.min here instead of range.start so the new selection range is not dependent on the direction of the previous selection?
There was a problem hiding this comment.
Good question. Inverted ranges can potentially be an issue. However, currentTextFieldValue?.composition and currentTextFieldValue?.selection guarantee that text range is correct, as well as selectedRange.
Generally - we're using start and end all over the text input code, so I would keep like this to match the rest. If we'll face the issue - we'll refactor it to min/max.
didUpdateMarkedRange()hack to keep cursor visible after adding marked text inputBasicTextFieldInputDelegateandCoreTextFieldInputDelegate- it's not needed for the password autocomplete.TextEditingScope.Fixes https://youtrack.jetbrains.com/issue/CMP-9999/iOS-NITI-Implement-markedText-methods
Release Notes
Fixes - iOS