Skip to content

Commit 51b401d

Browse files
committed
Fixed OTP text entry on iOS (thanks @pipiwoaini!)
Fixes #13717
1 parent 1506c40 commit 51b401d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/video/uikit/SDL_uikitviewcontroller.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,10 @@ - (void)keyboardDidHide:(NSNotification *)notification
575575
- (void)textFieldTextDidChange:(NSNotification *)notification
576576
{
577577
if (textField.markedTextRange == nil) {
578+
if (isOTPMode && labs((NSInteger)textField.text.length - (NSInteger)committedText.length) != 1) {
579+
return;
580+
}
581+
578582
NSUInteger compareLength = SDL_min(textField.text.length, committedText.length);
579583
NSUInteger matchLength;
580584

0 commit comments

Comments
 (0)