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

Options to keep the dropdown menu open #48

Open
egeersoz opened this issue Dec 6, 2023 · 3 comments
Open

Options to keep the dropdown menu open #48

egeersoz opened this issue Dec 6, 2023 · 3 comments

Comments

@egeersoz
Copy link

egeersoz commented Dec 6, 2023

Right now, the menu closes when a selection is made, and also when there's a mouse click outside anywhere on the screen.

We need two new options:

close_menu_after_selection: Defaults to false. If true, the dropdown menu stays open after an option is selected.
Use case: You type something to filter the options, then want to select several from the filtered list in quick succession. Right now you have to do it one by one, which is very cumbersome.

persistent_menu: Defaults to false. If true, the menu stays open and needs to be closed programmatically.
Use case: Right now there's no way to inspect the HTML markup of the dropdown field options, because the menu automatically closes when using the Inspect Element tool in Chrome. So we can't write tests for components that use LiveSelect!

@maxmarcon
Copy link
Owner

First option: sounds like a good idea, thanks! I'll work on it.

Second option: not sure why you need this for "writing tests". What kind of tests are you talking about here? An automated test can always inspect the generated DOM after a browser event, and this is unrelated to Chrome devtools.

However, if you want to manually inspect the dropdown content in Chrome devtools, you can use this simple technique.

@egeersoz
Copy link
Author

Hi there. Any development on this issue?

@maxmarcon
Copy link
Owner

hi @egeersoz. Unfortunately, I have 0 bandwidth to work on this right now. You're free to take a stab at it though, if you want to.Thx

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

No branches or pull requests

2 participants