reason-react
reason-react copied to clipboard
Support for aria-haspopup
The support for aria-haspopup is commented out:
https://github.com/reasonml/reason-react/blob/20c307f794298a514c7b23efbc02c3cdd21172d9/src/ReactDOMRe.re#L109
Is it possible to add support for this attribute? 🙏
This seems to be blocked by a feature missing in bucklescript, this is the comment rickyvetter made when he merged the code you have linked:
This adds all of the primitive aria types, but saves the token ones for when bs.deriving abstract supports bs.string polymorphic variants. Hopefully soon!
I think issue [@bs.string] for bs.deriving abstract in the bucklescript repo is the one that needs to be resolved before aria-haspopup
could be available.
It seems unfortunate that the use of many aria attributes is blocked on a low-priority feature request, and one which (from comments on the linked issue) isn't considered approachable for new contributors.
Perhaps to unblock these aria attributes, instead of leaving them out of the API, they should all just be given type string
? Yes, that loses the ability to strongly type these attributes, and yes, it would mean a breaking change later, but then people could use them to build accessible UI. /cc @rickyvetter
Unless the BuckleScript issue is getting resolved soon, then I agree that typing them as string
seems like the best solution. In terms of type-safety, it a small compromise to make, and isn't any worse than regular ReactJS. But not being able to use them at all is a major problem for ReasonReact, IMO.