4 ms·
> I think they should always be mirrored because they shouldn't be two separate elements That maintains one of the problems I'm worried about. If you have a mo
by jaffathecake 2y ago
> I think they should always be mirrored because they shouldn't be two separate elements
That maintains one of the problems I'm worried about. If you have a mouseenter listener on something in an <option> that triggers a fancy animation, you (surely most of the time) don't want that action repeated in the <selectedoption>, because it's the thing in the <option> that was hovered, not the thing in the <selectedoption>.
> You can use ::before, ::after, and general styling to do anything you need to.
You don't need to look at too many web sites to see examples where folks have added divs for styling, because pseudo-elements didn't provide enough style hooks.
- mminer237 2y agoYou can always add <div>s to the <option> itself and conditionally check whether it's `select > option` or `select::selected-option`.