Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not scroll when clicking cells #7717

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

sissbruecker
Copy link
Contributor

@sissbruecker sissbruecker commented Aug 29, 2024

Prevents scrolling when focusing a cell via click by:

  • Updating the scroll logic in scroll mixin to only take effect when the mouse is not used
  • Updating a Chrome + Webkit specific workaround for focusing on click to use focus({ preventScroll: true }) to avoid automatic scrolling by the browser

Fixes #7684

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removing the __scrollIntoViewport call in scroll mixin didn't cause any test failures, so I also added some general cases where scrolling a row into view would be expected.

For clicking I also added a separate test for the details cell, since the linked issue was about clicking the details cell specifically. With the current implementation it doesn't make a difference which cell in a row you click, but can't hurt to have more test cases I guess.

@sissbruecker sissbruecker marked this pull request as ready for review August 29, 2024 17:59
Copy link

@web-padawan web-padawan removed the request for review from vursen August 30, 2024 08:34
@web-padawan web-padawan merged commit fde6edd into main Aug 30, 2024
9 checks passed
@web-padawan web-padawan deleted the fix/grid-avoid-scroll-on-click branch August 30, 2024 08:35
web-padawan pushed a commit that referenced this pull request Aug 30, 2024
Co-authored-by: Sascha Ißbrücker <sissbruecker@vaadin.com>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha13 and is also targeting the upcoming stable 24.5.0 version.

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

Successfully merging this pull request may close these issues.

Grid with ItemDetailsRenderer performs unexpected scrolling [1 day]
4 participants