mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
[code] Prevent adding text in a script name when the textfield is full.
Change-Id: I31968f9fa62a7cf9904ed1f64f2833760510317a
This commit is contained in:
@@ -278,6 +278,12 @@ bool MenuController::textFieldDidReceiveEvent(TextField * textField, Ion::Events
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (event.hasText() && textField->isEditing()) {
|
||||
size_t eventTextLength = strlen(event.text());
|
||||
if (textField->draftTextLength() + eventTextLength >= TextField::maxBufferSize()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (event == Ion::Events::Left && textField->isEditing() && textField->cursorLocation() == 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user