[VueJs]disabled button are still clickable
Describe the bug disabled buttons are still clickable
To reproduce Steps to reproduce the behavior:
- Go to CodeSandbox example
- use the count button
- change state of the button
- click again ... the count continues to increase
Expected behavior nothing should happen when button is disabled
Context
- UI5 Web Components version 0.12.0
- OS/Platform: mac os
- Browser (if relevant): chrome
Affected components (if known) ui5-button
Hello @mehdijouan,
Try to use the semantic press event we are providing for the button.
I modified your snippet to
<ui5-button type="Positive" :disabled="isActive" v-on:press="updateCount">count</ui5-button>
And counter is not more increased.
Regards, Martin
P.S. looks like the view fires the onclick event no matter if the target is disabled or no.
To be honest, this sounds strange to me as even the native HTML Button does not fire the click event if the button is disabled.
https://jsbin.com/sokuwixoja/edit?html,output
Thanks for reporting! We were just thinking if we need this press event :D
Press works fine, thanks for the hint! I have also to admit that the onClick behavior is quite strange...
@mehdijouan we have removed all obstacles and are going to deprecate the press event in favour of click. With the next release, click should no longer be fired for disabled buttons so feel free to switch to using it as the recommended way.