Skip to content

Conversation

@acstll
Copy link
Contributor

@acstll acstll commented Dec 17, 2025

Summary

Relates to elastic/kibana#245368

In EuiDataGrid, when you click e.g. focus on a cell that is not fully visible, it will instantly scroll fully into view. Both axis. If you try to select text on a cell that is not fully visible, the scrolling will block you from making the selection.

This PR adds a small check for the text selection use case, right before doing the automatic scroll.

Let's tests this to see if it makes sense. It's been manually tested and fulfills the request in elastic/kibana#245368

Why are we making this change?

It's a papercut kind of fix. It improves UX.

Screenshots

Before

Check the clip in elastic/kibana#245368

After

Clip

Kapture 2025-12-17 at 10 05 19

Impact to users

🟢 None. No API or type changes.

QA

  • Test in this story, setting "Lines per row" to "auto" in the UI settings → you should be able to select text in cells that are not fully visible without the cell being scrolled into view

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
    • If the changes unblock an issue in a different repo, smoke tested carefully (see Testing EUI features in Kibana ahead of time)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@acstll acstll self-assigned this Dec 17, 2025
@acstll acstll added skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) support-duty-flywheel Label for PRs, see eui-private #310 labels Dec 17, 2025
this ensures the interaction is reliable, since scrolling will only happen after the pointer is up
@acstll acstll removed the skip-changelog Use on PRs to skip changelog requirement (Don't delete - used for automation) label Dec 19, 2025
@acstll acstll marked this pull request as ready for review December 19, 2025 08:36
@acstll acstll requested a review from a team as a code owner December 19, 2025 08:36
acstll and others added 2 commits December 19, 2025 14:43
Co-authored-by: Lene Gadewoll <lene.gadewoll@elastic.co>
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @acstll

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @acstll

@acstll acstll requested a review from mgadewoll December 19, 2025 14:36
useEffect(() => {
if (focusedCell) {
// do not scroll if text is being selected
if (isPointerDown || window?.getSelection()?.type === 'Range') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that I think about it: Should we add some tests for this to verify scrolling doesn't happen in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha! it wouldn't hurt, let me give it a try!

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

Labels

support-duty-flywheel Label for PRs, see eui-private #310

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants