-
Notifications
You must be signed in to change notification settings - Fork 8
Add an option to open and close the menu #161
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
Labels
Comments
I'm happy to see the component being used and appreciated by the Vue community, thanks for the kind words! To resolve the issue and avoid the small hack you've used, I can introduce a new optional prop Doing this will allow programmatic control over the menu open state. |
menuOpen prop would be great |
TotomInc
added a commit
that referenced
this issue
Jan 30, 2025
Fixes #161 Add an option to programmatically control the menu open state. * Add a new prop `isMenuOpen` to `src/Select.vue` to control the menu open state. * Update the `openMenu` and `closeMenu` methods to use the `isMenuOpen` prop. * Add a watcher to sync the `menuOpen` state with the `isMenuOpen` prop. * Update the documentation in `docs/props.md` to include the new `isMenuOpen` prop. * Add tests in `src/Select.spec.ts` to verify the functionality of the `isMenuOpen` prop. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/TotomInc/vue3-select-component/issues/161?shareId=XXXX-XXXX-XXXX-XXXX).
TotomInc
added a commit
that referenced
this issue
Jan 30, 2025
Fixes #161 Add an option to programmatically control the menu open state. * Add a new prop `isMenuOpen` to `src/Select.vue` to control the menu open state. * Update the `openMenu` and `closeMenu` methods to use the `isMenuOpen` prop. * Add a watcher to sync the `menuOpen` state with the `isMenuOpen` prop. * Update the documentation in `docs/props.md` to include the new `isMenuOpen` prop. * Add tests in `src/Select.spec.ts` to verify the functionality of the `isMenuOpen` prop. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/TotomInc/vue3-select-component/issues/161?shareId=XXXX-XXXX-XXXX-XXXX).
TotomInc
added a commit
that referenced
this issue
Jan 30, 2025
* feat: add isMenuOpen prop to programatically control menu state Fixes #161 Add an option to programmatically control the menu open state. * Add a new prop `isMenuOpen` to `src/Select.vue` to control the menu open state. * Update the `openMenu` and `closeMenu` methods to use the `isMenuOpen` prop. * Add a watcher to sync the `menuOpen` state with the `isMenuOpen` prop. * Update the documentation in `docs/props.md` to include the new `isMenuOpen` prop. * Add tests in `src/Select.spec.ts` to verify the functionality of the `isMenuOpen` prop. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/TotomInc/vue3-select-component/issues/161?shareId=XXXX-XXXX-XXXX-XXXX). * fix: improve input keydown space detection * fix(select): watch props.isMenuOpen should be immediate * feat(select): emit menuOpened and menuClosed, ensure closeMenu/openMenu are called internally * feat(docs): add menu-closed and menu-opened events * feat(docs): add controlled menu demo
Released in v0.8.0 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
First of all, thank you very much for the useful and purposeful library.
I wanted the menu to be open even before the user clicks, but I couldn't find such an option.
I also couldn't do it with
:ref="(e) => e.openMenu()"
because it's not exported bydefineExpose
(You can see how it is in Multiselect )
Update: I managed to do it this way :
But it would be helpful if there was an official way and with full control
The text was updated successfully, but these errors were encountered: