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

Working md-menu example #4161

Closed
treeder opened this issue Apr 17, 2023 · 15 comments
Closed

Working md-menu example #4161

treeder opened this issue Apr 17, 2023 · 15 comments

Comments

@treeder
Copy link

treeder commented Apr 17, 2023

When I use the example directly from the code, the menu doesn't show up, anyone have a working example they can share?

@Aworldc
Copy link

Aworldc commented Apr 17, 2023

Oof. The example is quite vauge and I couldn't understand it either. I hope someone makes documentation for it. Soon.

@treeder
Copy link
Author

treeder commented Apr 17, 2023

I added all the createRef() stuff from the Lit docs so that example can work and it seems to be doing something with no error, even the "show" attribute shows up in the dev console on md-menu, but I can't see it.

@e111077
Copy link
Contributor

e111077 commented Apr 18, 2023

Heya, sorry that's a bit vague – it's a balance to keep JSdoc concise for such a complex component. We obviously failed here 🤪

We are currently working on our demo / docs site, which should have more complete documentation with the Lit accoutrements that are littered in the JSdoc without explanation.

Here is a working example. There were a few regressions in the latest release that are fixed in the pre.7 release

https://lit.dev/playground/#gist=28fb863d2b2c3387f69b0cf2205a57b2

@treeder
Copy link
Author

treeder commented Apr 18, 2023

Thanks for the example @e111077 ! Will wait for pre.7 before trying again though.

@e111077
Copy link
Contributor

e111077 commented Apr 18, 2023

Definitely follow #4141 to get notified

@Aworldc
Copy link

Aworldc commented Apr 18, 2023

We are currently working on our demo / docs site, which should have more complete documentation with the Lit accoutrements that are littered in the JSdoc without explanation.

Woohoo! this is great news!

🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉🎉

@treeder
Copy link
Author

treeder commented Aug 3, 2023

Anyone have a non typescript example for md-menu? Got back to trying it again and still can't get this thing to work (just doesn't show up).

@e111077
Copy link
Contributor

e111077 commented Aug 3, 2023

@treeder here is a JS approach

https://lit.dev/playground/#gist=c558a9e054344de9495c007a9a6747a2

@e111077
Copy link
Contributor

e111077 commented Aug 3, 2023

Heads up, the docs for md-menu are on this sprint for me

@Aworldc
Copy link

Aworldc commented Aug 3, 2023

woohoo! 🎉🎉🎉

@treeder
Copy link
Author

treeder commented Aug 4, 2023

Thank you! 🙏

So finally got it working, but found a strange issue, not sure if there's a setting that fixes this or not (I'll make a new issue if not), but if menu is in top right, it opens fine on desktop, moves left to stay on the page:

image

But on mobile view, it goes off the side:

image

@e111077
Copy link
Contributor

e111077 commented Aug 4, 2023

Odd, it should try to stay in bounds. Have you tried setting menu-corner="START_END"?

@treeder
Copy link
Author

treeder commented Aug 4, 2023

That did actually work to make it visible on mobile:

image

image

But it's not the positioning I'd prefer. I'm assuming this is a bug then for the default positioning?

@e111077
Copy link
Contributor

e111077 commented Aug 4, 2023

You might also want to set anchor-corner="END_END"

the default is a default for a button menu. For this you should be customizing the corners

@asyncLiz
Copy link
Collaborator

Closing since we have menu doc planning tracked internally, it should pop up soon!

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

4 participants