[escher] Fixed TextField bug.

The Statistics apps crashed when navigating the Data table.
 -> Check that the textfield is editing before calling
textFieldShouldFinishEditing.
 -> Changed textLength() to draftTextLength().

Change-Id: Id373a7cd50438303f470abc5bcee7a795c33926a
This commit is contained in:
Léa Saviot
2017-11-27 15:22:48 +01:00
parent 4659d27c80
commit e43bbd38f2
8 changed files with 37 additions and 38 deletions

View File

@@ -198,7 +198,8 @@ void ConsoleController::tableViewDidChangeSelection(SelectableTableView * t, int
}
bool ConsoleController::textFieldShouldFinishEditing(TextField * textField, Ion::Events::Event event) {
return (strlen(textField->text()) > 0
assert(textField->isEditing());
return (textField->draftTextLength() > 0
&& (event == Ion::Events::OK || event == Ion::Events::EXE));
}