Skip to content

Commit bd7d470

Browse files
frenzibyteslouken
authored andcommitted
Fix text field resetting text when replaced with a short string
Triggered by auto-filling a password with less than 16 characters from a password manager.
1 parent 10478c5 commit bd7d470

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/video/uikit/SDL_uikitviewcontroller.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ - (void)setKeyboardHeight:(int)height
633633
- (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
634634
{
635635
if (textField.markedTextRange == nil) {
636-
if (textField.text.length < 16) {
636+
if ([string length] == 0 && textField.text.length < 16) {
637637
[self resetTextState];
638638
}
639639
}

0 commit comments

Comments
 (0)