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

[Combobox] Handles autocomplete correctly when allowNewValues is on #3287

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

KenAJoh
Copy link
Collaborator

@KenAJoh KenAJoh commented Oct 29, 2024

Description

Resolves #3286

Before, when both shouldAutoComplete and allowNewValues were enabled:

  • When having an autocompleted value, hitting enter treated it like a "new" value
  • This lead to seemingly existing values being added by their label

Sandbox for old bug

Component Checklist 📝

  • JSDoc
  • Examples
  • Documentation
  • Storybook
  • Style mappings (@navikt/core/css/config/_mappings.js)
  • Component tokens (@navikt/core/css/tokens.json)
  • CSS class deprecations (@navikt/aksel-stylelint/src/deprecations.ts)
  • Exports (@navikt/core/react/src/index.ts and @navikt/core/react/package.json)
  • New component? CSS import (@navikt/core/css/index.css)
  • Breaking change? Update migration guide. Consider codemod.
  • Changeset (Format: <Component>: <gitmoji?> <Text>. E.g. "Button: ✨ Add feature xyz.")

Copy link

changeset-bot bot commented Oct 29, 2024

🦋 Changeset detected

Latest commit: 4196b08

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

Storybook demo

Endringer til review: 0

d1b9c621f | 91 komponenter | 144 stories

Copy link
Contributor

@it-vegard it-vegard left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@KenAJoh KenAJoh merged commit 3c53127 into main Oct 30, 2024
4 checks passed
@KenAJoh KenAJoh deleted the combobox-autocomplete-enterbug branch October 30, 2024 13:51
@github-actions github-actions bot mentioned this pull request Oct 30, 2024
@HalvorHaugan
Copy link
Contributor

A Storybook test fails

@KenAJoh
Copy link
Collaborator Author

KenAJoh commented Oct 31, 2024

Nice catch @HalvorHaugan , hopefully fixed here #3306

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] Comboxbox: option.label, og ikke option.value, returneres når man velger forslag med autocomplete
3 participants