Skip to content

[EuiDataGrid] Expansion popover initial focus #5683

Closed

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

Activity

  1. cee-chen commented on Mar 3, 2022

    @cee-chen
    Contributor

    ++ to this proposal - I've always found it strange that we auto-jump to the first focusable item in the popover instead of showing the contents of the entire popover. @1Copenut are there any accessibility/screen reader recommendations for this that we're missing?

  2. 1Copenut commented on Mar 4, 2022

    @1Copenut
    Contributor

    There are potential a11y concerns with setting focus other than on the first text element inside a popover. In the description example moving focus to the Sri Lanka link as soon as the popover is opened may lead to missed context. Users might not always be ingesting the cell text "South Maude" immediately and then opening the popover.

    I'd like to explore setting focus on the popover itself consistently. This can be verbose where users will hear the helper text about being in a modal dialog and to press Escape to close. I've observed users moving quickly to the next text element when they hear this familiar message because they've normalized the modal UI and that the content they're interested in is one or two keypresses further on.

    @zuhairmahd please feel free to further or revise this proposal if there's an option or consideration I've overlooked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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