awran5 / react-simple-star-rating

A simple react component for adding a star rating to your project.
https://react-simple-star-rating.vercel.app/
MIT License
136 stars 32 forks source link

Unable to focus the Rating like input file #33

Open bhanu-p opened 2 years ago

bhanu-p commented 2 years ago

<Form.Control type="email" placeholder="name@example.com" autoFocus />

awran5 commented 2 years ago

Hi @bhanu-p, I'm not sure what are you trying to achieve with autoFocus. What do you want to happen when you focus it?

bhanu-p commented 2 years ago

We are expecting to move the cursor to give the rating at first(first priority), like this image

awran5 commented 2 years ago

I'll add accessibility support in my next release meanwhile, you could just wrap the Rating component with div or span element and set tabIndex attribute to 0 like so :

// your input here 

<div tabIndex={0}>
   <Rating {/* ... */ }  />
</div>

// another input