Skip to content

Commit 29cff6e

Browse files
frenzibyteslouken
authored andcommitted
Work around password integrations hiding software keyboard and preventing autofill
1 parent bd7d470 commit 29cff6e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/video/uikit/SDL_uikitviewcontroller.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,14 @@ - (void)keyboardDidHide:(NSNotification *)notification
554554

555555
- (void)textFieldTextDidChange:(NSNotification *)notification
556556
{
557+
// When opening a password manager overlay to select a password and have it auto-filled,
558+
// text input becomes stopped as a result of the keyboard being hidden or the text field losing focus.
559+
// As a workaround, ensure text input is activated on any changes to the text field.
560+
bool startTextInputMomentarily = !SDL_TextInputActive(window);
561+
562+
if (startTextInputMomentarily)
563+
SDL_StartTextInput(window);
564+
557565
if (textField.markedTextRange == nil) {
558566
NSUInteger compareLength = SDL_min(textField.text.length, committedText.length);
559567
NSUInteger matchLength;
@@ -588,6 +596,9 @@ - (void)textFieldTextDidChange:(NSNotification *)notification
588596
}
589597
committedText = textField.text;
590598
}
599+
600+
if (startTextInputMomentarily)
601+
SDL_StopTextInput(window);
591602
}
592603

593604
- (void)updateKeyboard

0 commit comments

Comments
 (0)