File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/react-native-aztec/ios/RNTAztecView Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -356,8 +356,10 @@ class RCTAztecView: Aztec.TextView {
356356
357357 // Replace occurrences of the obj symbol ("\u{FFFC}")
358358 textView. text = textView. text? . replacingOccurrences ( of: " \u{FFFC} " , with: " " )
359-
360- if let newPosition = textView. position ( from: textView. beginningOfDocument, offset: originalPosition) {
359+
360+ // Detect if cursor is off-by-one and correct, if so
361+ let newPositionOffset = originalPosition > 0 ? originalPosition - 1 : originalPosition
362+ if let newPosition = textView. position ( from: textView. beginningOfDocument, offset: newPositionOffset) {
361363 // Move the cursor to the correct, new position following dictation
362364 textView. selectedTextRange = textView. textRange ( from: newPosition, to: newPosition)
363365 }
You can’t perform that action at this time.
0 commit comments