5 ms·
Now I'm very curious why <summary> is a button. Off to read more. That second link is great, and this sentence caught my attention: "At the risk of being a bro
by tyingq 6y ago
Now I'm very curious why <summary> is a button. Off to read more.
That second link is great, and this sentence caught my attention: "At the risk of being a broken record; HTML really needs <accordion> , <tabs>, <dialog>, <dropdown>, and <tooltip> elements." At first glance, that sure would simplify a lot of the work I've done in the past.
- eyelidlessness 6y ago> Now I'm very curious why <summary> is a button. I’m fairly certain it’s a shadow DOM implementation detail. While it technically toggles a binary state and is probably more semantically similar to a checkbox, I think the way it’s exposed to web APIs makes that either impractical or non-obvious.
- hnbad 6y ago"Toggle buttons" are a thing in ARIA: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role#toggle_buttons https://developer.mozilla.org/en-US/docs/Web/Accessibility/A... Conceptually the summary is a toggle button: you click it to toggle the display state of the details element.
- eyelidlessness 6y agoThat’s true and what I assumed of summary. Although toggle buttons are fairly useless in plain HTML without JS, which is why checkbox is the more obvious semantic analogue outside the shadow DOM.
- asddubs 6y agothose, and some additional form elements/implementing the spec for existing ones (e.g. range) more fully would be great. There's a lot of widgets that get built over and over again that could really benefit from being in the browser (especially for accessibility's sake)