[escher] In textfield: when calling textFieldDidHandleEvent, precise if

there was any modification in the text
This commit is contained in:
Émilie Feral
2017-12-21 16:46:27 +01:00
committed by EmilieNumworks
parent 66ba406093
commit e8793c429c
6 changed files with 8 additions and 7 deletions

View File

@@ -322,7 +322,7 @@ bool MenuController::textFieldDidAbortEditing(TextField * textField, const char
return true;
}
bool MenuController::textFieldDidHandleEvent(TextField * textField, Ion::Events::Event event, bool returnValue) {
bool MenuController::textFieldDidHandleEvent(TextField * textField, Ion::Events::Event event, bool returnValue, bool textHasChanged) {
int scriptExtensionLength = strlen(ScriptStore::k_scriptExtension);
if (textField->isEditing() && textField->cursorLocation() > textField->draftTextLength() - scriptExtensionLength) {
textField->setCursorLocation(textField->draftTextLength() - scriptExtensionLength);