-
Notifications
You must be signed in to change notification settings - Fork 68
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
Button's setDisabledOnClick(true) has an enabling side effect when receiving click events due to pointer-events: auto (instead of none) #6183
Comments
|
Why would anyone set |
Oh, that I don't know. I was guessing my customer would have a legit use case. Querying it, hold on... |
They say they'd need the "pointer-events: auto" for several things such as focus or click handling even for disabled items. While they did not provide me with exact, concrete example, they do insist they know what they're doing and that there is a good reason for that. |
OK, this is already tracked at vaadin/web-components#4585. Moved the issue to the Flow components repo. |
@mshabarov @web-padawan Please note the BFP label. |
This issue has been added to the backlog priority queue for further investigation. |
While the |
I wonder if a different attribute could be used instead of disabled to achieve the desired effect? It still seems like the disabled state is being used inappropriately, and there actually might be a better alternative. |
Description of the bug
Any button that has
setDisabledOnCLick(true)
could possibly wrongly set a button to be enabled due to this code snippet:As one can see, the code assumes it is only executed when the button is enabled. This does not have to be the case, e.g. when setting pointer-events: auto then the click listener is executed too -- and it has the (wrong) side effect of enabling a button that was not enabled before (and should stay disabled).
better:
After all, the better code knows there was a click and it knows it should disable upon a click. There is no side effect when the click happens and the button was not enabled. I consider this to be more robust.
Expected behavior
Button should not surprisingly enable itself.
Minimal reproducible example
Set the
pointer-events: auto
for the disabled button.Versions
The text was updated successfully, but these errors were encountered: