Skip to content

refactor: use Lit for rendering menu-bar buttons #8871

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

Merged
merged 6 commits into from
May 1, 2025

Conversation

web-padawan
Copy link
Member

@web-padawan web-padawan commented Mar 27, 2025

Description

Fixes #8827

Based on #8829 but using a different approach uses Lit directive for rendering item components.

Extracted unit tests for item components into separate file and added more tests that use Flow-like logic.
These new tests are intended to pass with the latest version but fail with the first commit in the PR.

Also moved the logic for propagating button click events - it was added in vaadin/vaadin-menu-bar-flow@94ab8c1.
With the new approach, button instances can remain in the DOM so the connector logic would add listeners again.
IMO it's better to have this logic in the web component and don't manipulate DOM elements in the connector.

Verified that flow counterpart ITs pass locally with the above logic removed from the connector.

Type of change

  • Refactor

@web-padawan web-padawan force-pushed the fix/menu-bar-component-directive branch from 5311a13 to 535a993 Compare April 30, 2025 16:16
@web-padawan web-padawan marked this pull request as ready for review April 30, 2025 16:39
@web-padawan web-padawan force-pushed the fix/menu-bar-component-directive branch from 737cd02 to 535a993 Compare April 30, 2025 18:03
@web-padawan web-padawan requested a review from vursen May 1, 2025 10:19
Copy link

sonarqubecloud bot commented May 1, 2025

@web-padawan web-padawan merged commit 114fb7f into main May 1, 2025
9 checks passed
@web-padawan web-padawan deleted the fix/menu-bar-component-directive branch May 1, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Menu should not close when toggling a setting item
2 participants