Browse Source

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.
Salman Alshamrani 8 tháng trước cách đây
mục cha
commit
bd7d4708e3
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      src/video/uikit/SDL_uikitviewcontroller.m

+ 1 - 1
src/video/uikit/SDL_uikitviewcontroller.m

@@ -633,7 +633,7 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
 - (BOOL)textField:(UITextField *)_textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
 {
     if (textField.markedTextRange == nil) {
-        if (textField.text.length < 16) {
+        if ([string length] == 0 && textField.text.length < 16) {
             [self resetTextState];
         }
     }