pmndrs / react-three-a11y

♿️ Accessibility tools for React Three Fiber

Home Page:https://docs.pmnd.rs/a11y/introduction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A11y required props

servinlp opened this issue · comments

Hi there,

I'm trying to use this package with typescript and it seems that on, for what I've seen at the moment, the A11y component only has required props. Is this for a reason? If not, which ones are actually required?

Hello @servinlp

I'm not very familiar with typescipt so It's very likely that I marked all property as required by accident.

The only really required prop would be the role one.
Then depending on the role, other props might be necessary or not usable at all.

If there is a way to have conditional required field in typescript I'd be happy to update the package so it doesn't ask for props that you don't actually need.

You can see what props are expected for each roles here https://github.com/pmndrs/react-three-a11y#the-three-roles-of-the-a11y-component

If something isn't clear, feel free to join the poimandres discord https://discord.gg/poimandres
There is a react-three-a11y channel where I'd be happy to help and discuss.

Hi @AlaricBaraou

After a little searching I came across this, Discriminated Union. Might be something we could use to specify what props are required with what role.

If I have some time I'll play around with it to see if this would work.

Thank you @servinlp , that would be amazing.

I'm a little busy recently but if I I get a chance I'll also try your suggestion.

Please feel free to reach out if you have any question about react-three-a11y.

Hello @servinlp

I'm dealing with this today or tomorrow at the latest.
Since I have time, I don't want you to use your time unnecessary.
I'll still be happy to have feedback from you once I'm done though !

@servinlp It should work fine now with the latest 2.0.1

Let me know if this fix your issue when you have time.

Cool, I'll probably will continue with this somewhere this week.

I'll assume it's working fine since the release and close this issue.

Let me know if anything else seems off ! 🙂