You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While creating a demo, I was wondering about something.
When using an SVG inside of an option. Do we expect the "selected-value" to also contain the SVG inside of it when selected? This doesn't seem the case at the moment.
This could really help with styling some sort of UI patterns.
Personally, I believe it should contain everything the option has inside of it. If the developer does not want to show the SVG inside of the selected-value, this could be easily achieved by targeting and hiding it with CSS.
This at least would be easier than the other way around.
Another (maybe far fetched) possibility is to add an extra attribute to the "selected-value" such as allow-all="true"which would then take the full content of the option.
<selectmenuclass="potion-select"><buttonclass="potion-equipped" slot="button" behavior="button"><spanbehavior="selected-value" class="selected-value"><!-- this will only show the text --></span></button><divslot="listbox"><divpopover="" behavior="listbox"><optionvalue="health"><divclass="potion-holder"><svgclass="icon icon-health" aria-hidden="true"><usexlink:href="#potion" /></svg></div><span>Health</span></option><!-- and others --></div></div></selectmenu>
The text was updated successfully, but these errors were encountered:
This is sort of a duplicate of the issue you mentioned indeed. Although my question was about inner content specific. I'll try to follow along with the related issue as this is also discussed there.
@brechtDR that topic does pivot to discuss the inner content since we noticed that while the OP asked about styles authors may want the internal content as well (as you've brought up).
While creating a demo, I was wondering about something.
When using an SVG inside of an option. Do we expect the "selected-value" to also contain the SVG inside of it when selected? This doesn't seem the case at the moment.
This could really help with styling some sort of UI patterns.
Personally, I believe it should contain everything the option has inside of it. If the developer does not want to show the SVG inside of the selected-value, this could be easily achieved by targeting and hiding it with CSS.
This at least would be easier than the other way around.
Another (maybe far fetched) possibility is to add an extra attribute to the "selected-value" such as
allow-all="true"
which would then take the full content of the option.The demo can be found here (use Chrome Canary):
https://codepen.io/utilitybend/pen/zYLoqge
And example code
The text was updated successfully, but these errors were encountered: