mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-11 17:05:41 +00:00
Reset text field content on text input stop
This commit is contained in:
parent
b2c2a483e8
commit
eadc64973a
1 changed files with 8 additions and 2 deletions
|
|
@ -528,6 +528,7 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
|
|||
return true;
|
||||
}
|
||||
|
||||
[self resetTextState];
|
||||
return [textField resignFirstResponder];
|
||||
}
|
||||
|
||||
|
|
@ -657,8 +658,7 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
|
|||
{
|
||||
if (textField.markedTextRange == nil) {
|
||||
if (textField.text.length < 16) {
|
||||
textField.text = obligateForBackspace;
|
||||
committedText = textField.text;
|
||||
[self resetTextState];
|
||||
}
|
||||
}
|
||||
return YES;
|
||||
|
|
@ -675,6 +675,12 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
|
|||
return YES;
|
||||
}
|
||||
|
||||
- (void)resetTextState
|
||||
{
|
||||
textField.text = obligateForBackspace;
|
||||
committedText = textField.text;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue