-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
InserterMenu: Don't leak arrow key presses
As a user, pressing the wrong group of arrows (e.g. down instead of right or tab) shouldn't take the focus out of the inserter. This is most easily experienced when using VisualEditorSiblingInserter, the inserter sitting in between any two blocks.
- Loading branch information
Showing
2 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ac75a8a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'd prefer to do this in a different way. TabbableContainer should handle it via a prop I think, as it's going to be common.
ac75a8a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The capability was there at one point, but we removed it in some of the refactoring (I think). I think TabbableContainer should be able to stop arrow keys propagating. Or do you think it shouldn't be its concern?
ac75a8a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just about to ask you about this change. I initially thought of making this a proper option, but I wonder if it prematurely adds complexity/burden of choice. What do you think?
I agree it's very plausible, but so far still speculative. Should we hold off, or do you prefer implementing now? My main motivation was to not ship the PR with that unexpected behavior of focus shift.
ac75a8a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see your point. I'm happy enough with it now, but won't be surprised if we need to change it later :)
ac75a8a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally, it's thus paramount that our code remain easy to refactor. :)