Hacker News new | ask | show | jobs
by hlandau 604 days ago
This seems overcomplicated. Maybe I'm missing something, but is there some reason not just to define a psuedoelement on the current option?

  option::picker-current { ... }
1 comments

The aim of <selectedoption> is to provide a DOM placeholder to contain a clone of the contents of the selected <option>. It isn't there as a style hook for the selected option in the popover - that already exists via option:selected.

You aren't the first to get mixed up here. Personally I think <selectedoption> is a misleading name. I wish it was called something like <selectedcontent>, but I don't know if that is much better https://github.com/openui/open-ui/issues/1112

selection?
Generally means "selected text". I've pitched <selectedcontent>, since it's the content of the selected option.