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

fix(material/menu): prevent interaction with <a> in disabled menu items (#30203) #30261

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

IgnacioCabanellas
Copy link

Fix the issue where tags inside disabled mat-menu-items were still interactive, allowing users to navigate even when the menu item was disabled.

Problem:

  • The anchor links inside disabled mat-menu-items were still interactive.
  • Users could right click on them and navigate to the associated link with the Open link in new tab for example, despite the items being disabled.

Solution:

  • Added the CSS rule pointer-events: none; to disable interaction with anchor tags inside disabled mat-menu-item elements.

Additional Information:

Fixes #30203

@IgnacioCabanellas IgnacioCabanellas requested a review from a team as a code owner January 2, 2025 00:48
@IgnacioCabanellas IgnacioCabanellas requested review from crisbeto and mmalerba and removed request for a team January 2, 2025 00:48
@IgnacioCabanellas IgnacioCabanellas changed the title fix(material/menu): prevent interaction with <a> in disabled menu ite… fix(material/menu): prevent interaction with <a> in disabled menu items (#30203) Jan 2, 2025
@crisbeto
Copy link
Member

crisbeto commented Jan 2, 2025

We intentionally removed the pointer-events: none in #19183 to avoid a different issue.

@IgnacioCabanellas IgnacioCabanellas marked this pull request as draft January 2, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug(COMPONENT): Inconsistency in behavior of a[mat-button] and a[mat-menu-item] when disabled
2 participants