-
Notifications
You must be signed in to change notification settings - Fork 424
Menu pattern: moving focus on hover often triggers problematic focus jumps #3238
Related to this guidance on the Editor Menubar example in the APG:
When a submenu is open and the user hovers over an item in the submenu, focus follows hover.
Reading through past issues, it looks like this was largely added for parity with desktop behavior rather than for any specific accessibility benefit on its own merit. The problem is that it also isn't neutral -- this guidance can cause some pretty unfortunate glitchy focus jumps that I think outweigh any potential benefit of strictly copying desktop behavior.
There are two scenarios that cause issues:
-
When the mouse is positioned somewhere within the menu and the menu has scroll overflow, every time keyboard arrowing triggers scroll, focus will jump back up under the mouse cursor. Here is a reduced case demonstrating this bug: https://codepen.io/smhigley/full/ZYEGeLO.
There is a more involved way to implement this that would not trigger focus just based on the item scrolling under the mouse cursor using the
mousemoveevent, but it is both less likely to be implemented that way, and when it is, the menu is even more prone to stealing focus at the slightest mouse bump or tremor (see the next point) -
When the mouse is positioned somewhere within the menu and the user brushes their hand against a trackpad or bumps their mouse, focus will jump.
Both these issues are even more likely to happen if the user has their mouse cursor move when a control is activated, which would automatically pull the cursor up to the menu when it is opened, making it more likely to hover over a menuitem.
While I do agree with the guidance that mouse hover essentially needs to move focus when it causes the currently focused menu to close and a new one to open, I think the second point about hover always moving focus within an open menu should be reconsidered. I'm not sure there's really any benefit to doing so other than the nebulous "copy desktop patterns" idea, which I don't believe should carry more weight than avoiding harmful behaviors.
What do other folks think? Are there any UX benefits to having focus follow hover that I'm missing?
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
Issue actions