The updateValue methods in the UITextField and UITextView appear to be tickling a UIKit bug, causing the cursor to unexpectedly jump to the end of the text field while editing.
In the example app, enter some text with a double-width unicode character, such as 🍕 , in the middle. For instance, I entered "Ryan 🍕 Forsythe".
Move the cursor back to the middle of the text. For instance, I moved the cursor to just after the "n" character.
Type any character or hit the backspace
That character appears at the cursor, but then the cursor immediately jumps to the end of the text field.
This repro is for UITextField, but we're seeing the same issue in UITextView. If the whole text field is single-width characters (the ASCII region of unicode works for this) this bug doesn't happen, so I assume this is actually a bug in UIKit. The fix is pretty easy, though. I've forked and made the change, and will send a PR referencing this issue.
The
updateValue
methods in theUITextField
andUITextView
appear to be tickling a UIKit bug, causing the cursor to unexpectedly jump to the end of the text field while editing.This repro is for
UITextField
, but we're seeing the same issue inUITextView
. If the whole text field is single-width characters (the ASCII region of unicode works for this) this bug doesn't happen, so I assume this is actually a bug in UIKit. The fix is pretty easy, though. I've forked and made the change, and will send a PR referencing this issue.