mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 13:37:11 +00:00
Fixes #3830 - Editing messages not placing the cursor at the end of the text
This commit is contained in:
parent
1bc3723c34
commit
fb8d69dd92
@ -139,10 +139,16 @@ private struct UITextViewWrapper: UIViewRepresentable {
|
||||
// https://github.com/element-hq/element-x-ios/issues/3104
|
||||
textView.selectedTextRange = selection
|
||||
} else {
|
||||
// Re-setting the selected range is important when inserting pills
|
||||
// but we need to not do that when entering edit mode, where the
|
||||
// cursor needs to stay at the end of the text
|
||||
// https://github.com/element-hq/element-x-ios/issues/3830
|
||||
if textView.selectedRange.location != text.length {
|
||||
textView.selectedRange = selectedRange
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func makeCoordinator() -> Coordinator {
|
||||
Coordinator(text: $text,
|
||||
|
Loading…
x
Reference in New Issue
Block a user