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 issue where clicking Combobox.FilteredOptions after scrolling caused the wrong element to be selected #2536

Conversation

it-vegard
Copy link
Contributor

Description

https://nav-it.slack.com/archives/C7NE7A8UF/p1701437323067429

When clicking an element in Combobox.FilteredOptions after scrolling, the list scrolled to the top and the new element under the cursor was selected.

This onBlur triggered when clicking items in FilteredOptions, causing the virtual focus to be moved and the list to scroll to the top.

Change summary

Removed an onBlur that did not really have any use, but caused the mentioned bug.

… virtual focus to be moved and the list to scroll to the top.

Then, onPointerUp, we select the new element that has scrolled into position under the cursor.
Copy link

changeset-bot bot commented Dec 1, 2023

🦋 Changeset detected

Latest commit: 147f4e1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@navikt/ds-react Patch
@navikt/ds-css Patch
@navikt/ds-tokens Patch
@navikt/ds-tailwind Patch
@navikt/aksel-icons Patch
@navikt/aksel Patch
@navikt/aksel-stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 1, 2023

Storybook demo

Endringer til review: 8

0c8d1a611 | 61 komponenter | 400 stories

@it-vegard it-vegard merged commit df48236 into main Dec 5, 2023
2 checks passed
@it-vegard it-vegard deleted the bugfix/combobox-clicking-option-after-scrolling-selects-wrong-option branch December 5, 2023 08:58
@github-actions github-actions bot mentioned this pull request Dec 5, 2023
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.

3 participants