mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
fix: validator not called after backspace
This commit is contained in:
parent
71a749c980
commit
df3640978d
1 changed files with 6 additions and 1 deletions
|
|
@ -830,7 +830,12 @@ void TextBox::performEditingKeyboardEvents(Keycode key) {
|
||||||
bool shiftPressed = gui.getInput().pressed(Keycode::LEFT_SHIFT);
|
bool shiftPressed = gui.getInput().pressed(Keycode::LEFT_SHIFT);
|
||||||
bool breakSelection = getSelectionLength() != 0 && !shiftPressed;
|
bool breakSelection = getSelectionLength() != 0 && !shiftPressed;
|
||||||
if (key == Keycode::BACKSPACE) {
|
if (key == Keycode::BACKSPACE) {
|
||||||
if (!eraseSelected() && caret > 0 && input.length() > 0) {
|
bool erased = eraseSelected();
|
||||||
|
if (erased) {
|
||||||
|
if (validate()) {
|
||||||
|
onInput();
|
||||||
|
}
|
||||||
|
} else if (caret > 0 && input.length() > 0) {
|
||||||
if (caret > input.length()) {
|
if (caret > input.length()) {
|
||||||
caret = input.length();
|
caret = input.length();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue