summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2018-01-12 02:53:03 +0100
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2018-02-23 13:01:28 +0100
commite15fe296bdbcbab038fe0a918a3cb739826e8271 (patch)
tree41bad6dfea1638987f5585421932f870e5bd49cb
parente3eb6869068edb2617a311f89e93b92a9aa5b905 (diff)
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
-rw-r--r--scene/gui/line_edit.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 03dc6686b8..5c0e8fefc7 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -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;