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

Menu with Links as MenuItems #243

Open
will-moore opened this issue Oct 18, 2022 · 2 comments
Open

Menu with Links as MenuItems #243

will-moore opened this issue Oct 18, 2022 · 2 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@will-moore
Copy link

Hi, I would like to create a menu where each MenuItem is a link (using svelte).
Something like Github's options to filter pull requests:

Screenshot 2022-10-18 at 16 06 45

Is there a way I can use my own link component as a MenuItem?

Failing that, I was going to handle the user clicking on a MenuItem and update the URL manually when the user clicks on a MenuItem. But I don't see where to handle that?
The MenuItem provides handlers for onOpen={(selectedItem) => console.log('onOpen - selectedItem: ', selectedItem)} and onClose={() => console.log('onClose called...')} but neither of these is fired when the user clicks on the MenuItem.
Actually, onClose() is called after that but it isn't passed the ``selectedItem`.

@roblevintennis roblevintennis added bug Something isn't working enhancement New feature or request labels Jan 16, 2023
@Cybolic
Copy link

Cybolic commented Jun 15, 2023

At the risk of just being a bump, I too would like to see an example of how the Menu component is supposed to be used as I can't seem to figure it out either.
Apart from the points about the handlers that @will-moore already mentioned, I don't see anything like selectedItem to bind to or any other way to actually reliably use the component (outside of ugly hacks like checking the classes on the menu items on close).

@zacharygriffee
Copy link

Was thinking this would be a straight-forward component. But, after a good few hours of messing with it, and contemplating hacks myself, I decided to check on github to find I'm not the only one. I also attempted to inherit the MenuItem component with my own menu component, but issues of the MenuItem, while could be easily forwarded, exported functions "isDisabled" and "focus" get messed up. In my opinion, if you got to jump through hoops to get it working, then why even have it?

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

No branches or pull requests

4 participants