react-tags
react-tags copied to clipboard
Can't turn off autofocus
Even with autofocus={false} and autoFocus={true} on a different input, it always focuses on the tags component.
I suppose I'm supposed to be more technical here, but I don't know what else to include.
Simple example:
import React from "react";
import { WithContext as ReactTags } from 'react-tag-input';
const ReactTagsTwo = () => {
return (
<React.Fragment>
<input
value={""}
autoFocus={true}
/>
<input
value={""}
autoFocus={false}
/>
<ReactTags
autoFocus={false}
/>
</React.Fragment>
)
}
export default ReactTagsTwo;
Please excuse my very clever naming scheme.
@kellyprogramsthings the prop is autofocus, its not your fault, we should rename the prop to be semantically correct :p
We can share the fault, as if I had actually read it instead of assuming, I wouldn't have had a problem. But thank you!
Thank you. autofocus should really be false on default
I have added a prop autoFocus and will be remove autofocus in 7.x - https://github.com/react-tags/react-tags/pull/951
As per turning off the autofocus, I think we should do that as this would improve A11y as well since there will be other important components in the webpage and redirecting focus to the tags might be distracting for screen reader users.
Closing this as this was resolved.