-
Notifications
You must be signed in to change notification settings - Fork 863
Description
I'd like to discuss the behavior of cell popovers' initial focus behavior. To be honest, this may even apply more broadly to EuiPopover in general, but the problem is very highlighted in the EuiDataGrid.
When clicking on a cell with simple text, or a single interactive element, or plain text with a cell action, the behavior feels good to initially focus on the first focusable element.



The problem
Where it breaks down is when there is more complex cell contents, like in the row heights example.
When there's an interactive element within the cell contents that possibly very far down, that's what gets focused and therefore the popover auto-scrolls to this element:
This isn't great for the specific reason that it feels buggy to not show the start of the contents.
Possible solution: Auto-focus the popover instead
It's already part of the tab order, just make it the first focused item. We might want to consider how we handle the visible focus ring, but this feels much clearer and expected.

Pros:
- For complex content this will keep the start of the content visible
- Screen readers should be able to now read the full cell contents instead of jumping to a random link within
- For simple content with cell actions, screen-readers will read the full cell contents instead of jumping to the cell action which may not provide context
Cons:
- For simple content, the extra focus may be visually distracting
- ??
