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 🚸 tweaks for single select #3124

Merged
merged 4 commits into from
Aug 30, 2024

Conversation

JulianNymark
Copy link
Contributor

@JulianNymark JulianNymark commented Aug 28, 2024

Description

Closes https://github.com/navikt/team-aksel/issues/577
This + #3071 Closes #2891

Change summary

  • hide the selected value when inputing text
  • delete input value on blur (you must actually select something with intent to select it, this prevents the field from "looking like it's filled in when it's actually not")

Versioning 🏷️

  • Run yarn changeset to generate a version-entry for change.
    • Bug/hotfix: Patch

- hide the selected value when inputing text
- delete input value on blur (you must actually select something with
  intent to select it, this prevents the field from "looking like it's
  filled in when it's actually not")
Copy link

changeset-bot bot commented Aug 28, 2024

🦋 Changeset detected

Latest commit: e3f1b0c

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 Aug 28, 2024

Storybook demo

Endringer til review: 5

8cd4ca0bc | 88 komponenter | 139 stories

@JulianNymark JulianNymark marked this pull request as ready for review August 28, 2024 13:27
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.

Seems like filtered search is preserved onBlur, making previous search like "app" be the default after re-entering the field.
https://github.com/user-attachments/assets/c5a8f201-b685-4116-8cb2-0fe21e5abcbf

Reproduce:

  • "Default" combobox-story
  • write and select "banana"
  • write "app"
  • tab -> shift + tab to blur -> re-enter field
  • now shows results for "app" again

@JulianNymark
Copy link
Contributor Author

JulianNymark commented Aug 29, 2024

Seems like filtered search is preserved onBlur, making previous search like "app" be the default after re-entering the field. https://github.com/user-attachments/assets/c5a8f201-b685-4116-8cb2-0fe21e5abcbf

Reproduce:

* "Default" combobox-story

* write and select "banana"

* write "app"

* tab -> shift + tab to blur -> re-enter field

* now shows results for "app" again

nice catch! (turns out I shouldn't have shied away from clearInput(), for some reason I thought it was going to clear the selected options, but it's actually exactly what I wanted here.)

@JulianNymark JulianNymark merged commit 32c13c0 into main Aug 30, 2024
4 checks passed
@JulianNymark JulianNymark deleted the combobox-test-single-input-changes branch August 30, 2024 07:35
@github-actions github-actions bot mentioned this pull request Aug 30, 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.

[Innspill Combobox] Ser ut som at man skal velge flere ting i single select: <Combobox />
2 participants