-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(menu): Allow anchor links as menu list items #3680
fix(menu): Allow anchor links as menu list items #3680
Conversation
The current logic prevents anchor links from firing when clicked on in the menu, a fairly common case.
…chor tags. Also submitted a PR upstream to fix. material-components/material-components-web#3680 #311
Codecov Report
@@ Coverage Diff @@
## master #3680 +/- ##
=======================================
Coverage 98.48% 98.48%
=======================================
Files 120 120
Lines 5227 5227
Branches 657 657
=======================================
Hits 5148 5148
Misses 79 79
Continue to review full report at Codecov.
|
This doesn't work when the user clicks on the text or graphic of the link. We can set Adding the following to the end of the
|
Ah, yeah that makes sense. |
@jamesmfriedman Can you give me access to your repo to add this snippet? |
Sorry for the delay. Added you as a collaborator. |
…r mdc-list-item elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @williamernest! |
@jamesmfriedman @williamernest thanks for the fix! But it looks like it doesn't solve the following comment: #3486 (comment) |
@yguedidi we set pointer events none on the elements within the list to ensure the anchor tag gets clicked and we don't prevent default on the event. Any custom markup you add inside the list item should also set pointer events to none. |
The current logic prevents anchor links from firing when clicked on in the menu, a fairly common case.
fixes: #3486