Reset text field content on text input stop
This commit is contained in:
committed by
Sam Lantinga
parent
b2c2a483e8
commit
eadc64973a
@@ -528,6 +528,7 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[self resetTextState];
|
||||||
return [textField resignFirstResponder];
|
return [textField resignFirstResponder];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,8 +658,7 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
|
|||||||
{
|
{
|
||||||
if (textField.markedTextRange == nil) {
|
if (textField.markedTextRange == nil) {
|
||||||
if (textField.text.length < 16) {
|
if (textField.text.length < 16) {
|
||||||
textField.text = obligateForBackspace;
|
[self resetTextState];
|
||||||
committedText = textField.text;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
@@ -675,6 +675,12 @@ static void SDLCALL SDL_HideHomeIndicatorHintChanged(void *userdata, const char
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)resetTextState
|
||||||
|
{
|
||||||
|
textField.text = obligateForBackspace;
|
||||||
|
committedText = textField.text;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user