Add better support for custom elements in menu items.

Review Request #13678 — Created March 28, 2024 and submitted

Information

Ink
master

Reviewers

The original menu implementation allowed for a childEl to be passed
in, containing a custom element to render in the menu item. This item
took precedence over the "inner" part of the menu item, but this meant
that the implementation just had to duplicate that or risk breaking both
styling and events.

This is now applied inside the "label" area instead. That fixes styling
issues, allows for icons and shortcuts alongside a custom element, and
gives the implementation free reign to put whatever they want in an item
without breaking things.

While fixing this, I found that custom child elements couldn't be
provided during crafting. This is now accepted as a valid option on the
subcomponent.

Unit tests pass.

Summary ID
Add better support for custom elements in menu items.
The original menu implementation allowed for a `childEl` to be passed in, containing a custom element to render in the menu item. This item took precedence over the "inner" part of the menu item, but this meant that the implementation just had to duplicate that or risk breaking both styling and events. This is now applied inside the "label" area instead. That fixes styling issues, allows for icons and shortcuts alongside a custom element, and gives the implementation free reign to put whatever they want in an item without breaking things. While fixing this, I found that custom child elements couldn't be provided during crafting. This is now accepted as a valid option on the subcomponent.
70f2c1be38a554d5e98ace2e73f1c31ade61ffe2
david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (60461de)
Loading...