refactor: use Lit for rendering menu-bar buttons #8871
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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