Add cause field to FocusGained event#23993
Conversation
…llOnFocus behavior
|
This touches on many different files, please let me know if the choices to propagate
|
|
Closes #23976 |
|
Can you say more about why this is useful? I think I have an intuition, but it's helpful to write it down explicitly. |
|
Looks good overall. One issue to consider is whether "initial" focus should be considered "navigated" or "pressed". For example, when a modal dialog opens, it is common practice to set focus to some widget inside the dialog. If the dialog contains a text input field, then we will want to select all the text so that the user can immediately start typing, without having to click on it. Similar logic goes for input fields with the Other widgets that automatically set focus on opening are popup menus, but in that case it doesn't matter. However, for consistency, I would suggest that "navigated" be the choice for any widget that is automatically focused when it appears. (We could add a third option to the FocusCause enum, but I don't see the need and it would make the logic more complex.) |
Objective
Solution
FocusCausefield toFocusGainedeventSelectAllOnFocus)Testing
feathers_galleryto test that its text gets highlighted