i-like-robots / react-tags

⚛️ Legacy repo for the fantastically simple tagging component for your React projects (legacy repo)
http://i-like-robots.github.io/react-tags
MIT License
457 stars 170 forks source link

Add optional prop to entirelly disable text input #237

Closed jack-fin closed 3 years ago

jack-fin commented 3 years ago

This addition was useful for my team.

We had another component that we created that would add and remove tags on react-tags. We did not want the user to be able to type any tags into the input field, they needed to use the other component to add or remove tags from react-tags.

This PR adds an optional flag to entirely disable the input box in react-tags. Opening the PR in case it is useful to others.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 99.296% when pulling 3b86b89b2fc9cd64c326cb049feb350f0cc6cd72 on jack-fin:master into 9d32cf75746c6af62226bcdafa526798402d7f9f on i-like-robots:master.

i-like-robots commented 3 years ago

Thank you for taking the time to submit this @jack-fin but I'm afraid I'm not going to accept it.

I agree the ability to disable the component is a useful feature and I'd like to approach it more carefully, adding disabled state (and styles) to the container, selected tags, and input and ensuring it remains accessible.

For now if you do need to disable the input alone then you can do so via the inputAttributes prop. Thanks again!