Skip to content

Comments

Removed click event when dropdown item is disabled#2023

Merged
kelseythejackson merged 6 commits intonextfrom
kj/bug-bash-dropdown-click-event
Feb 20, 2026
Merged

Removed click event when dropdown item is disabled#2023
kelseythejackson merged 6 commits intonextfrom
kj/bug-bash-dropdown-click-event

Conversation

@kelseythejackson
Copy link
Collaborator

Issue: wa-dropdown-item fires click events when disabled (#1817)

Solution: Added pointer-events: none to disabled dropdown items via both CSS and JavaScript.

Changes:

  1. dropdown-item.styles.ts - Added CSS rule:
  :host(:state(disabled)),
  :host([disabled]) {
    pointer-events: none;
  }
  1. dropdown-item.ts - Added inline style in updated() lifecycle:
  this.style.pointerEvents = this.disabled ? 'none' : '';
  1. dropdown-item.test.ts - Added regression tests:
    • should not fire click event when disabled
    • should fire click event when not disabled

This approach (CSS + JavaScript) ensures the fix works:

  • CSS provides the base styling and works for static disabled states
  • JavaScript inline style handles dynamic disabled state changes

@vercel
Copy link

vercel bot commented Feb 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
webawesome Ready Ready Preview Feb 19, 2026 11:31pm

Request Review

@kelseythejackson kelseythejackson merged commit 136c036 into next Feb 20, 2026
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants