0
I’m using React Select to work with input tags. By inserting something into the input and pressing enter, the tag is inserted... The point is that I could not find anything related to limitations of tags in the documentation or internet. I would like to limit at most some 10 tags. I tried to use YUP to remedy this problem, but to no avail. I am using React Select Creatable (https://react-select.com/creatable). If there was something in the pre-ready documentation it would be much better. One idea that was in my mind, was to check the tags you have in the application state, and then make a condition to know if there are 10 tags or not. Suggestions about this possible solution are very useful.
Code snippet I’m using:
<CreatableSelect
styles={customStyles}
inputValue={inputValue}
components={components}
isClearable
isMulti
menuIsOpen={false}
onChange={this.handleChange}
onInputChange={this.handleInputChange}
onKeyDown={this.handleKeyDown}
placeholder="Aperte enter para inserir a tag"
value={value}
/>
https://github.com/JedWatson/react-select/issues/1392#issuecomment-289631819
– Gaspar
I tried the possibilities but it didn’t work, man.
– Victor