Browse Source

Consume additional text widget events during keyboard navigation

"Navigate to end" event should not be marked as out of bounds navigation. Furthermore, modifiers being used typically indicate that the user is manipulating the text widget, so always consume the events here then.
Michael Ragazzon 1 year ago
parent
commit
8a76da6d24
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Source/Core/Elements/WidgetTextInput.cpp

+ 2 - 2
Source/Core/Elements/WidgetTextInput.cpp

@@ -631,7 +631,7 @@ void WidgetTextInput::ProcessEvent(Event& event)
 		default: break;
 		}
 
-		if (!out_of_bounds || selection_changed)
+		if (shift || ctrl || !out_of_bounds || selection_changed)
 			event.StopPropagation();
 		if (selection_changed)
 			FormatText();
@@ -861,7 +861,7 @@ bool WidgetTextInput::MoveCursorHorizontal(CursorMovement movement, bool select,
 	}
 	break;
 	case CursorMovement::EndLine: SetCursorFromRelativeIndices(cursor_line_index, lines[cursor_line_index].editable_length); break;
-	case CursorMovement::End: absolute_cursor_index = INT_MAX; break;
+	case CursorMovement::End: absolute_cursor_index = (int)GetValue().size(); break;
 	}
 
 	const int unclamped_absolute_cursor_index = absolute_cursor_index;