Line edit up/down focus pass through

When line edit receive a up/down and the cursor is at beginning/end it
will not set the input as handled
This commit is contained in:
Fabio Alessandrelli 2018-01-12 02:53:03 +01:00
parent e3eb686906
commit e15fe296bd

View file

@ -373,12 +373,14 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
case KEY_UP: {
shift_selection_check_pre(k->get_shift());
if (get_cursor_position() == 0) handled = false;
set_cursor_position(0);
shift_selection_check_post(k->get_shift());
} break;
case KEY_DOWN: {
shift_selection_check_pre(k->get_shift());
if (get_cursor_position() == text.length()) handled = false;
set_cursor_position(text.length());
shift_selection_check_post(k->get_shift());
} break;