Skip to content
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

fix(ui5-toolbar): correct event handlers attachment #10546

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

dobrinyonkov
Copy link
Contributor

@dobrinyonkov dobrinyonkov commented Jan 14, 2025

Fixes: #10415

The Toolbar component now attaches event listeners directly in the template, replacing the previous onEnterDOM approach. This ensures handlers are available immediately after rendering, resolving race conditions and improving test reliability.

Event handling is now managed by the abstract items themselves, rather than the toolbar mediating events. Items fire a new internal "close-overflow" event to notify the toolbar when the overflow menu should close.

@kgogov kgogov self-requested a review January 16, 2025 14:38
button.get(0).addEventListener("click", cy.stub().as("clicked"));
});

cy.get("ui5-button", { includeShadowDom: true }).contains("Button 1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add test for select as well

@dobrinyonkov dobrinyonkov merged commit f6d6c67 into main Jan 20, 2025
10 checks passed
@dobrinyonkov dobrinyonkov deleted the toolbar-event-handlers branch January 20, 2025 12:53
@ui5-webcomponents-bot
Copy link
Collaborator

🎉 This PR is included in version v2.7.0-rc.1 🎉

The release is available on v2.7.0-rc.1

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.

[OP / Toolbar(Button) V2]: Hydration of Header Toolbar Actions
5 participants