Skip to content

Conversation

@nnaydenow
Copy link
Contributor

@nnaydenow nnaydenow commented May 22, 2025

The ui5-button component currently has a click event listener attached to its root element. This listener prevents the native click event from propagating and instead triggers a custom event.

However, there's an issue: when the ui5-button has a visible border defined on the custom element, clicking that border can trigger a native click event. This happens because only the root element inside the Shadow DOM is observed, not the host element itself.

This PR resolves the issue by adding a click event handler to the host element as well, ensuring consistent event behavior regardless of where on the button the user clicks.

Issue is introduced with: #11318

Fixes: #11556

@nnaydenow nnaydenow changed the title fix(ui5-button): fire event with correct type fix(ui5-button, ui5-toggle-button): fire event with correct type Jun 6, 2025
@nnaydenow nnaydenow merged commit 4414126 into main Jun 6, 2025
19 of 20 checks passed
@nnaydenow nnaydenow deleted the btn-fix branch June 6, 2025 07:57
@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.12.0-rc.0 🎉

The release is available on v2.12.0-rc.0

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Panel]: Raise error sometimes

4 participants