You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A <vaadin-button> marked as disabled can still emit click events if you cancel its pointer-events: none CSS rule.
Expected outcome
A disabled button should not emit click events
Minimal reproducible example
<scripttype="module">constbutton=document.querySelector('vaadin-button');button.style.pointerEvents='auto';button.addEventListener('click',()=>{console.log('Button clicked');});// Dynamically import the button to make sure the fix also works in cases// where the event listener is added before the web component is defined.import('@vaadin/button');</script><vaadin-buttondisabled>Edit</vaadin-button>
Steps to reproduce
Open the page with the provided snippet
Click the disabled button
See the logs
Environment
Vaadin version(s): All
Browsers
Issue is not browser related
The text was updated successfully, but these errors were encountered:
tomivirkki
changed the title
disabled button can emit click events
Disabled button can emit click events
Apr 15, 2024
Note: according to vaadin/flow-components#6183 (comment), some people expect to be able to listen for clicks on disabled buttons. If we fix this issue, then the linked BFP would be affected.
Arguably, if you're modifying the default CSS of the button in a way that, by definition, affects its behavior, the change in behavior is your choice. So I don't see this as a bug since it works as intended unless you mess with it.
Description
A
<vaadin-button>
marked asdisabled
can still emit click events if you cancel itspointer-events: none
CSS rule.Expected outcome
A
disabled
button should not emit click eventsMinimal reproducible example
Steps to reproduce
Environment
Vaadin version(s): All
Browsers
Issue is not browser related
The text was updated successfully, but these errors were encountered: