Skip to content

[EuiDataGrid] Users can lose sight of actions menu #8484

Closed

Description

@JasonStoltz

Describe the bug

Depending on the scroll position within the EuiDataGrid, the cell actions menu can actually appear behind the header and/or footer, potentially causing users to not realize the actions are available.

There are two cases in which this bug can occur:

1. When scrolling, a user can lose sight of the actions menu when it scrolls behind the header cells
On it's own, I don't perceive this as a big issue. I believe most users would simply scroll the actions back into view just like any other content that gets scrolled out of view. However, it's made worse by the next scenario.

giphy1

3. When a user clicks on a cell and it snaps into focus, the actions menu is not visible
Because it focuses as top-aligned, the user never sees the actions menu and is unaware that it is scrolled out of view.

giphy2

Impact and severity
Short of any real user data here, I perceive this as likely a low severity issue. My hunch is that most users familiar with using the Data Grid will realize this is happening and work around it. However, it could be a persistent annoyance for users, and is likely worse for users that are new to using the Data Grid.

Environment and versions

  • EUI version: v100
  • React version:
  • Kibana version (if applicable):
  • Browser:
  • Operating System:

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://eui.elastic.co/#/tabular-content/data-grid#virtualization
  2. Focus a cell and scroll, or click on a cell that is partially above the current datagrid view box. Reference the example videos above to reproduce concisely.

Expected behavior
At no point should the actions menu be hidden behind content when a cell is focused.

Minimum reproducible sandbox
N/A - It's reproducible directly in the docs.

Screenshots
N/A - Videos included above

Proposal

We considered the easiest solution here to be simply adjusting the z-index of the actions menu. The UX would not be great:
giphy5

We also considered placing the actions menu below the cell at all times, rather than above, but we'll encounter the same issues with the bottom of the table as we do currently with the top.

We currently think the best solution would be to dynamically show the actions menu below the cell (rather than above) in cases where it scrolls past the top of the data grid view. We would implement this with an intersection observer. The primary concern here would be that is could degrade performance. Our proposal here would be to do a quick spike of this behavior to share with the OP and design teams to consider both performance and UX.

Activity

  1. added
    ⚠️ needs validation
    on Mar 20, 2025
  2. added theissue type on Mar 20, 2025
  3. added this to the milestone on Mar 20, 2025
  4. removed
    ⚠️ needs validation
    on Mar 20, 2025
  5. JasonStoltz commented on Mar 27, 2025

    @JasonStoltz
    ContributorAuthor

    We discussed this in person.

    We think there may be a simpler solution where we simply apply an offset to the scroll/focus behavior to accomodate the actions menu.

    If it works technically, we'll need to validate it with design team.

  6. removed this from the milestone on Apr 9, 2025
  7. weronikaolejniczak commented on Apr 25, 2025

    @weronikaolejniczak
    Contributor

    Hey @ryankeairns @ek-so what do you think about this solution?

    Screen.Recording.2025-04-25.at.17.01.22.mov

    Clicking or focusing a cell scrolls it into view with enough space for the actions menu. You can test this in the staging docs.

    The menu can still be hidden behind the header when scrolling, but as noted:

    Most users will likely just scroll it back into view like any other content.

    This issue doesn’t affect the first row, so no problem there:

    Image

  8. ek-so commented on Apr 28, 2025

    @ek-so
    Contributor

    Thanks @weronikaolejniczak! Overall, works fine from my pov. A couple of notes:

    1. I noticed a bug — when selecting 1st row cell and scrolling up, there's a weird overlap:
      Image
    2. It would be nice to have a smooth (but quick) scrolling animation, when I select a cell above the one that I'm currently on, so that I can catch with the eyes what happened (change of the position in the table). Otherwise, sometimes I lose a track. Not a critical one, only if possible.
  9. weronikaolejniczak commented on Apr 28, 2025

    @weronikaolejniczak
    Contributor

    I'm sorry peeps for the crazy task history but dragging tasks across the board sometimes causes rapid scrolling and moves the item into another column 😅 I think I'll switch to status select from now on.

    @ek-so

    Ad 1. On the surface it seems like the actions menu z-index is purposefully set to higher value than the header so that it's visible for the first row. All the other actions menu have a lower z-index so they scroll under the header.
    Not sure what to do about this 🤔 In theory I could reset the z-index to lower when the table is scrolled the height of the first actions menu BUT that would involve an intersection observer, hacky logic, not sure if it's worth it. Might be worth looking into it on a separate task.

    Ad 2. Agreed! This might be simple to fix with behavior: smooth but if prefers-reduced-motion is set then the scrolling will still be snappy. I'll try making it smooth 😄

  10. JasonStoltz commented on Apr 28, 2025

    @JasonStoltz
    ContributorAuthor

    Might be worth looking into it on a separate task.

    FWIW, this is a pre-existing issue, so I think it would be fine to handle it separately.

  11. weronikaolejniczak commented on Apr 29, 2025

    @weronikaolejniczak
    Contributor

    Actually, smooth-scrolling might not be as easy to implement as I thought because we use scrollTo from react-window which doesn't support smooth scrolling out-of-box and isn't affected by things like CSS scroll-behavior. There are custom solutions to this but involve custom logic that might be tricky to implement in our data grid. I'd say let's focus on the issue at hand, and try to figure out the above-mentioned issues on separate tasks. I created both:

  12. JasonStoltz commented on Apr 29, 2025

    @JasonStoltz
    ContributorAuthor

    @weronikaolejniczak Is there any way to conditionally not do the offset for the last row in the grid? It currently offsets the last row too far down.

    Image

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

Metadata

Metadata

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions