You don't know HTML Lists

(blog.frankmtaylor.com)

139 points | by speckx 1 hour ago

10 comments

  • asveikau 33 minutes ago
    Title reminds me of Joni Mitchell.

        I've looked at lists from both sides now
        From give and take and still somehow
        It's HTML lists' illusions I recall 
        I really don't know HTML lists at all
  • appplication 1 hour ago
    This was a fun little read. Just through testing the examples, I also learned datalist does not seem to work well on mobile safari (which is a large enough market I might even say there’s essentially no scenario in which it’s worth using if there’s a compatibility issue).
    • MattGaiser 40 minutes ago
      Way back when I was working my first job, datalist didn’t work on Firefox. That’s what got Firefox removed from the list of supported browsers.

      It has been a problem for a long time if you want to support anything other than Chrome.

  • VladVladikoff 56 minutes ago
    >What if there’s a bunch of options, but for [reasons] we don’t want a user to be able to select a subset of them? Let’s add the disabled attribute to an optgroup

    Seems broken in mobile safari, not actually disabled I can still select the disabled items.

    • p2detar 49 minutes ago
      Not broken, but strange since it should be working on latest Safari.

      https://caniuse.com/mdn-html_elements_optgroup_disabled

      I think it may be a Safari bug.

      • quantumleaper 28 minutes ago
        Your link states it's not supported in iOS Safari at all, even though it has been supported in macOS Safari since 2013.
      • tvmalsv 13 minutes ago
        Came here to mention the same thing. Very well be on me, tho. I’m using the Brave browser (is it safari-powered?) and on iOS 18.7.9, which is the newest my old iPhone X supports.
  • jdw64 38 minutes ago
    HTML linters actually help distinguish things like that? I'm curious if there are any linters out there that can enforce this kind of semantic tag selection.
  • montroser 55 minutes ago
    Good stuff, except don't get too excited about `datalist`. It just doesn't have enough hooks to be actually useful for anything other than a little prototype.
    • iammrpayments 44 minutes ago
      I think I’ve tried building a combobox using datalist once but it didn’t work
  • jimmaswell 1 hour ago
    Lots of useful information I wasn't aware of after being a front-end lead for years. I'll start using these at work for sure.
  • WA 11 minutes ago
    And yet, no native select + search combined, which is a very common kind of list. The datalist is basically unusable, because you don't know any of the options.
  • reconnecting 59 minutes ago
    This is how real HTML magic should look like:

    <MARQUEE>

      <OL>
          <LI>One</LI>
          <LI>Two</LI>
          <LI>Three</LI>
      </OL>
    
    </MARQUEE>
    • recroad 53 minutes ago

          <BLINK>
            <MARQUEE>
              <OL>
                <LI>One</LI>
                <LI>Two</LI>
                <LI>Three</LI>
              </OL>
            </MARQUEE>
          </BLINK>
      
      FTFY
      • Trufa 6 minutes ago
        blink wont work, but marquee will
      • reconnecting 50 minutes ago
        <MARK>FTFY</MARK>
  • zombot 1 hour ago
    What I always wanted to know about lists and never dared to ask!
  • MagicMoonlight 50 minutes ago
    That’s a really good article. It’s nice to see something which isn’t slop.