mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[apps] Calling draftTextLength should be done only if text field is editing
This commit is contained in:
@@ -350,9 +350,11 @@ bool MenuController::textFieldDidFinishEditing(TextField * textField, const char
|
||||
|
||||
bool MenuController::textFieldDidHandleEvent(TextField * textField, bool returnValue, bool textSizeDidChange) {
|
||||
int scriptExtensionLength = 1 + strlen(ScriptStore::k_scriptExtension);
|
||||
const char * maxPointerLocation = textField->text() + textField->draftTextLength() - scriptExtensionLength;
|
||||
if (textField->isEditing() && textField->cursorLocation() > maxPointerLocation) {
|
||||
textField->setCursorLocation(maxPointerLocation);
|
||||
if (textField->isEditing()) {
|
||||
const char * maxPointerLocation = textField->text() + textField->draftTextLength() - scriptExtensionLength;
|
||||
if (textField->cursorLocation() > maxPointerLocation) {
|
||||
textField->setCursorLocation(maxPointerLocation);
|
||||
}
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user