framework7io / framework7-website

Framework7 website for contributing and offline usage
http://framework7.io
160 stars 433 forks source link

Documentation for Smart Select recommends invalid HTML #628

Closed ekwoka closed 11 months ago

ekwoka commented 11 months ago

https://framework7.io/docs/smart-select

Here all the examples show an a tag around the select.

This is outside of spec.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#technical_summary

nolimits4web commented 11 months ago

And it is still valid and works totally fine everywhere

ekwoka commented 11 months ago

So you disagree with the HTML Working Group?

ekwoka commented 11 months ago

Also, it does NOT "work totally fine everywhere"

Example:

https://play.tailwindcss.com/gGIEhYd4j5

This produces two focusable elements that are indistinguishable when tabbing.

And for what?

what does an a do there that's useful? Why isn't it just a div? or span?

So to summarize:

  1. It's out of spec to put a select inside an a
  2. It creates two focusable elements, one of which won't really work
  3. It adds nothing to the implementation over alternative element choices.