Add better support for custom elements in menu items.
Review Request #13678 — Created March 29, 2024 and submitted — Latest diff uploaded
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.