Consider allowing <hr> within list elements (ol, ul, menu) #9126
Labels
a11y-tracker
Group bringing to attention of a11y, or tracked by the a11y Group but not needing response.
accessibility
Affects accessibility
addition/proposal
New features or enhancements
document conformance
I saw that #9124 was made today, and it reminded me that I had been wanting to file this issue for some time.
Late last year, I was working with developers who wanted to 'group' their list items, but did not want to include nested lists as they reasonably did not want to expose 3 nested lists within a larger list. Rather, as they were visually delineating the groupings of list items by a horizontal separator, they thought to use an
hr
element. But as that was not valid HTML, they then did<li role=separator>
. But that role is also an invalid child of a list element, or element with role=list.Their other option was to nest the hr within an li element, but that included it in the total count of list items, which was not their intent.
They finally settled on
<li aria-hidden=true><hr></li>
to mitigate the validation errors, and to ensure the separator did not contribute to the list item count total, but at the loss of exposing any separator semantics.As HTML updated to allow
div
to groupdt
anddd
elements, and per the mentioned PR #9124 to allowhr
withinselect
, it seems reasonable thatol
,ul
andmenu
elements should also allowhr
as a way to separateli
elements into 'groups'. There doesn't appear to be a parsing issue with this now, but as my testing (from oct 2022) shows, there are presently some inconsistencies with how AT handles the separator. But these inconsistencies could be ironed out if this was an allowed pattern, as opposed to the current behavior which is essentially mitigating author 'error'.The text was updated successfully, but these errors were encountered: