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

SelectMenu onBlur selects first item when searchable is true #1252

Closed
NilsEvers opened this issue Jan 18, 2024 · 7 comments
Closed

SelectMenu onBlur selects first item when searchable is true #1252

NilsEvers opened this issue Jan 18, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@NilsEvers
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v21.5.0
  • Nuxt Version: 3.9.1
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: npm@10.2.4
  • Builder: -
  • User Config: modules, ssr, devtools, typescript, imports, colorMode, ui, sanctum
  • Runtime Modules: nuxt-auth-sanctum@0.0.14, @nuxt/ui@2.12.0, @nuxtjs/color-mode@3.3.2, @nuxtjs/i18n@8.0.0, @vueuse/nuxt@10.7.2
  • Build Modules: -

Version

v2.12.0

Reproduction

  1. Add a SelectMenu with the searchable prop set to true
  2. No value is yet selected in the SelectMenu
  3. Open the menu
  4. Click outside the menu to cancel the selection
  5. The first item will be selected now

The issue can easily be reproduced with the example from the docs.

Description

When using the SelectMenu with searchable set to true, the first item is selected when clicking outside the menu.

If the selection is cancelled by pressing the esc key the issue does not occur.

Additional context

No response

Logs

No response

@NilsEvers NilsEvers added the bug Something isn't working label Jan 18, 2024
Copy link
Member

Indeed, I've never noticed that. Unfortunately, it has something to do with Headless UI Combobox internal behaviour, it does the same thing when playing with their example: https://headlessui.com/vue/combobox.

Maybe this https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-vue/src/components/combobox/combobox.ts#L1239?

@NilsEvers
Copy link
Author

Your right, the problem is upstream. I created an issue for Headless UI.

Copy link
Member

benjamincanac commented Jan 18, 2024

The next release will have this d67c748 that pins @headlessui/vue to the previous version so it doesn't break any combobox. The issue was also present in the CommandPalette and InputMenu as they all use the Combobox.

Copy link
Member

Should be fixed in https://github.com/nuxt/ui/releases/tag/v2.12.1.

@gamersover
Copy link

Looks like the InputMenu still have this issue.

@GrothDK
Copy link

GrothDK commented Apr 25, 2024

Yeh, i'm also running into this issue.....
Edit: There is a recent open issue about this. #1708

@1hakr
Copy link

1hakr commented May 16, 2024

The issue still exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants