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
feat(ui5-button): make click button preventable (#11318)
Currently, the click event on the `ui5-button` is the native click event from the user interaction. This creates some problems. One main issue is that the click event cannot be prevented because the event handler in the template is always attached first. This means that the `isPrevented` flag is missing if the event is prevented during the bubble phase.
A bigger problem happens when the `ui5-button` has `type="Submit"` and is inside a HTML form element. In this case, each time the button is clicked, the form is submitted, even if the click event is prevented.
This pull request fixes the issue by changing the click event to a `CustomEvent`, instead of the native `Event`. In most cases, only `event.target` or `event.currentTarget` are used, and no other event details are usually needed. To provide backward compatibility the new custom event includes the original native event inside its `e.detail.originalEvent`, so users can still access the original event if needed.
Fixes: #11103Fixes: #9830
0 commit comments