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

Close navbar-dropdown on item click #17

Open
Follpvosten opened this issue Apr 8, 2021 · 2 comments
Open

Close navbar-dropdown on item click #17

Follpvosten opened this issue Apr 8, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Follpvosten
Copy link
Contributor

I'm writing a simple app using ybc and yew-router, triggering routing by using href on navbar items.
Some of these are in a navbar-dropdown, and I've noticed that the dropdown only closes when you click on the overlay, but not when you click on an item in the dropdown; this doesn't really work for my usecase, where the dropdown is used like a menu to navigate the page as described above.
I think this could be fixed by (maybe optionally) internally handling the onclick event on the dropdown itself, which should catch any clicks on its children if they're not getting cancelled (so this approach would still allow overriding this behavior for specific items in any case).
Would you be interested in a PR implementing a feature like that? And if so, should it be an option or the default case? And if it should be optional, what should I call the property on NavbarDropdown?

@thedodd
Copy link
Owner

thedodd commented Apr 9, 2021

Hey there @Follpvosten! That sounds pretty reasonable. You could also just use the hover functionality on the dropdown. As soon as the user is no longer hovering, then the dropdown will be removed.

Otherwise, the closest functionality that we currently have like that is the Modal and related components. You might find some inspiration there. Keep me posted!

@thedodd thedodd added the enhancement New feature or request label Apr 9, 2021
@Follpvosten
Copy link
Contributor Author

Follpvosten commented Apr 9, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants