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

[USelectMenu] async search combined with loading removes focus from input field #1117

Closed
rigtigeEmil opened this issue Dec 17, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@rigtigeEmil
Copy link

Environment

  • Operating System: Windows_NT
  • Node Version: v19.8.1
  • Nuxt Version: 3.8.1
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: ssr, typescript, devtools, vue, runtimeConfig, ui, modules, extends, app
  • Runtime Modules: @nuxt/[email protected], @pinia/[email protected]
  • Build Modules: -

Version

2.11.1

Reproduction

https://stackblitz.com/edit/nuxt-ui-nqrf9b?file=app.vue

Description

When using an async searchable USelectMenu that sets a loading state while fetching results removes focus from the input field when the loading state changes.

Additional context

No response

Logs

No response

@rigtigeEmil rigtigeEmil added the bug Something isn't working label Dec 17, 2023
Copy link
Member

Indeed, you should not use the loading prop for this behaviour as it will disable the button. This should be used when submitting a form for example.

You're trying to show the loading state when searching right? Would this #520 fix your issue?

@rigtigeEmil
Copy link
Author

Exactly - and yes, #520 would fix it (although it'd be nice to be able to customize it with a slot). I'll await the PR. Thanks!

@benjamincanac
Copy link
Member

@rigtigeEmil I've changed my mind, you can now use the loading prop and it will no longer disable the SelectMenu!

@rigtigeEmil
Copy link
Author

@benjamincanac Fantastic! Thanks again. Looks great 👍

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

2 participants