charlie-yao / react-aria-widgets

Implementations of WAI-ARIA widgets and design patterns in React.
MIT License
2 stars 0 forks source link

Helper types for e.g. elements that only allow phrasing content as children #148

Open charlie-yao opened 1 year ago

charlie-yao commented 1 year ago

Though browsers might let us get away with it anyway, some HTML elements only allow certain kinds of content. For example, <button> allows:

Phrasing content, but there must be no interactive content descendant and no descendant with the tabindex attribute specified.

(See: https://html.spec.whatwg.org/dev/form-elements.html#the-button-element)

It might be nice to add helper types to enforce these rules, especially for the sake of accessibility.