3 ms·
It's valid in this latest proposal. It becomes the item displayed on the page rather than the browser-controlled 'button'. In browsers that don't support custo
by jaffathecake 2y ago
It's valid in this latest proposal. It becomes the item displayed on the page rather than the browser-controlled 'button'.
In browsers that don't support customisable select, the button is ignored.
https://codepen.io/jaffathecake/pen/NWQaxmG?editors=1100 https://codepen.io/jaffathecake/pen/NWQaxmG?editors=1100 - compare this in Chrome Canary with chrome://flags/#enable-experimental-web-platform-features vs other browsers (or the flag disabled).
- Y-bar 2y agoAll I can find is a Chrome experiment. Do you have a draft spec available? Edit: Found a link to the Chrome blog which in turn links to https://github.com/whatwg/html/issues/9799 https://github.com/whatwg/html/issues/9799 Initial question remains however, how are we to properly distinguish the user interface actions?
- jaffathecake 2y agoWhat does "distinguish the user interface actions" mean here? The browser knows the <button> that's a child of <select> is special, and activates the popover on click. This is handled automatically, as is the accessibility tree.
- Y-bar 2y agoIf it is special, why not use a new element and not one with a history and a clear use today? From my experience it seems to muddle the concept of the existing element. An <a> for example never behaves differently depending on if it is part of a (DOM) tree with a <div> or a <p> as a parent/grandparent.
- jaffathecake 2y agoIt does. An <a> doesn't work as usual when it's within a <button> for instance. <button> already behaves differently depending on the type of form it's in, or whether it's in a form at all. Let me put it another way: If you use a <select> today, what's the difference between the thing that renders on the page and a <button>? They look different, sure, but that's a matter of styling. You can already style a <button> to look like a <select> activator. They can receive focus, and they can be activated. They're buttons.
- Y-bar 2y agoAdding another gotcha will help no-one. This line of argument reminds me of Plat's "featherless bipeds" as a definition of man. Everything's a button if you are ambiguous enough, sure. It's not _wrong_ but it also dilutes things to where semantic meaning no longer exists.