reason-react icon indicating copy to clipboard operation
reason-react copied to clipboard

Support for aria-haspopup

Open laufeyrut opened this issue 6 years ago • 3 comments

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? 🙏

laufeyrut avatar Dec 17 '18 07:12 laufeyrut

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.

mikaello avatar Feb 21 '19 15:02 mikaello

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

jwhitley avatar May 25 '19 15:05 jwhitley

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.

johnridesabike avatar Jul 21 '19 21:07 johnridesabike