Skip to content

[EuiDataGrid] Expansion popover initial focus #5683

@cchaos

Description

@cchaos

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.
Screen Shot 2022-03-03 at 09 52 59 AM
Screen Shot 2022-03-03 at 09 52 52 AM
Screen Shot 2022-03-03 at 09 53 14 AM

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:

Screen Shot 2022-03-02 at 17 29 24 PM

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.
Screen Shot 2022-03-03 at 09 46 53 AM

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
  • ??

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions