Is there a reason why div is the default element type for VisuallyHidden? #7144
Unanswered
BrendanBerkley
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Ha! I never knew about this. Looks like they are trying to get it relaxed whatwg/html#9705 as it seems a bit of a silly requirement. I think it can be considered a false positive. As for the default, we apply a margin on the element, and if I'm recalling correctly a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just ran my markup through the HTML validator and I got a bunch of errors saying:
Element div not allowed as child of element button in this context.
Buttons only want phrasing content and divs are flow content. I can change elementType to "span"; I get all of that.
But is there a reason why div is the default for this component? The thing is visually hidden, so the intrinsic things that div vs span bring shouldn't be relevant there. Are there any accessibility considerations here? Would it be a breaking change to change the default?
Beta Was this translation helpful? Give feedback.
All reactions