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

Bugfix/prevent submit on enter in combobox #2861

Merged
merged 18 commits into from
Apr 18, 2024

Conversation

it-vegard
Copy link
Contributor

@it-vegard it-vegard commented Apr 17, 2024

Description

Presently, pressing enter inside of Combobox will trigger onSubmit if it is inside of a form (as it should be).
Fixed #2808

Change summary

Preventing submit on Enter-presses inside of Combobox.

Copy link

changeset-bot bot commented Apr 17, 2024

🦋 Changeset detected

Latest commit: 9b1c8b7

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 Apr 17, 2024

Storybook demo

bbe0620b6 | 61 komponenter | 202 stories

KenAJoh
KenAJoh previously approved these changes Apr 17, 2024
Copy link
Collaborator

@KenAJoh KenAJoh left a comment

Choose a reason for hiding this comment

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

🚀 Ser ut til å fungere bra 🚀

Bare et åpent sprøsmål, men bør enter i teorien submitte form så lenge Enter ikke har en annen handling? Så i tilfellene

  • Input er tomt, popover er lukket
  • Du har valgt et element (f.eks banana), og trykker så enter etter det
  • Autocomplete er tomt, popover er lukket etc
  • Sikkert flere caser

Blir raskt en ganske kompleks sjekk onEnter, så kanskje aller enkleste er å bare ignorere disse edgecasene og bare kjøre på med foreslått løsning i PR-en

…side effects, but we need to remove virtual focus at least. That way we won't double-click on enter.
…eed to click the toggleIsOpen button to check that the option is un-selected
Copy link
Collaborator

@KenAJoh KenAJoh left a comment

Choose a reason for hiding this comment

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

🚢 🇮🇹

@it-vegard it-vegard merged commit c2f3da8 into main Apr 18, 2024
2 checks passed
@it-vegard it-vegard deleted the bugfix/prevent-submit-on-enter-in-combobox branch April 18, 2024 08:00
@github-actions github-actions bot mentioned this pull request Apr 18, 2024
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.

[BUG] Combobox: Form blir submitted når man skal legge til et nytt valg med Enter
2 participants