Skip to content

fix(ui-select): prevent scrolling when last item is hovered in Chrome#2028

Merged
ToMESSKa merged 1 commit into
masterfrom
INSTUI-4361-select-autoscrolls-down-when-bottom-items-is-hovered
Jun 24, 2025
Merged

fix(ui-select): prevent scrolling when last item is hovered in Chrome#2028
ToMESSKa merged 1 commit into
masterfrom
INSTUI-4361-select-autoscrolls-down-when-bottom-items-is-hovered

Conversation

@ToMESSKa

@ToMESSKa ToMESSKa commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

INSTUI-4361

ISSUE:

  • in Chrome, Select starts scrolling when the bottom area of the last visible item is hovered and scrollToHighlightedOption is true

TEST PLAN:

  • open the examples in Select in Chrome
  • open the listbox and start hovering around the bottom edge of the last item and the listbox
  • it should not scroll to the next item (like it does in the current version)

@ToMESSKa ToMESSKa self-assigned this Jun 17, 2025
@ToMESSKa ToMESSKa requested a review from Copilot June 17, 2025 08:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a Chrome-specific scrolling issue in the Select component by applying a tolerance adjustment to the computed maximum height when the last option is hovered.

  • Added a constant SCROLL_TOLERANCE to control the adjustment amount.
  • Adjusted the maxHeight computation by subtracting SCROLL_TOLERANCE on Chromium browsers.
  • Introduced a standalone call to utils.isChromium().

Comment thread packages/ui-select/src/Select/index.tsx Outdated
@ToMESSKa ToMESSKa force-pushed the INSTUI-4361-select-autoscrolls-down-when-bottom-items-is-hovered branch from 63ba740 to 8b72537 Compare June 17, 2025 08:12
@github-actions

github-actions Bot commented Jun 17, 2025

Copy link
Copy Markdown
PR Preview Action v1.6.1
Preview removed because the pull request was closed.
2025-06-24 09:23 UTC

Comment on lines +533 to +534
// in Chrome, we need to prevent scrolling when the bottom area of last item is hovered
(utils.isChromium() ? this.SCROLL_TOLERANCE : 0),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

to prevent this, I clipped the bottom of the listbox by 0.5px.

@ToMESSKa ToMESSKa requested review from balzss and matyasf June 17, 2025 14:02
@ToMESSKa ToMESSKa merged commit 51cd81a into master Jun 24, 2025
11 checks passed
@ToMESSKa ToMESSKa deleted the INSTUI-4361-select-autoscrolls-down-when-bottom-items-is-hovered branch June 24, 2025 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants