News for hackers. Stuff that matters.
Re:HTML Data List Element by CodesInChaos on Wednesday June 23, 2021 @08:11AM (#27603507)
I don't like that this relies on globally unique ids to link elements. I would prefer the ability to specify some kind of relative path instead. (there are similar problems in other areas, like aria)
Re:HTML Data List Element by AbsoluteDestiny on Wednesday June 23, 2021 @09:04AM (#27604068)
Every linked element relies on ids: anchors, the label for attribute, all of the aria-labelledby, controls, describedby etc. Sure a full selector would be better but what level of css selectors do you support when writing the spec for user agents to know that can support the element?
Re:HTML Data List Element by earthboundkid on Wednesday June 23, 2021 @02:41PM (#27608361)
This is a general problem with HTML5. I end up having to write some kind of autoincrementIdCounter function in every frontend templating language I use to work around it. I wish it was on W3C's radar as a thing that makes life harder for developers.
Re:HTML Data List Element by whoisthemachine on Wednesday June 23, 2021 @08:49AM (#27603881)
Yeah it's kind of awkward. My first assumption would have been that it would have had semantic similarities to a `<select>`, ie

  <input type="datalist">
    <option>a</option>
  </input>
Re:HTML Data List Element by chrismorgan on Wednesday June 23, 2021 @09:04AM (#27604064)
<input> has been an empty element right from the start, meaning it mustn’t have any children. (And the HTML syntax enforces this.)
Re:HTML Data List Element by CodesInChaos on Wednesday June 23, 2021 @08:50AM (#27603895)
AFAIK <input> is hardcoded as self-closing in the html5 parser.
Re:HTML Data List Element by whoisthemachine on Wednesday June 23, 2021 @12:44PM (#27606578)
Hm interesting... presumably this could be changed though? We aren't locked to <input> following one convention, are we?