You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the solution you'd like
Need to have inputValue as props of MuiChipsInput.
Code usage sample
exportdefaultfunctionScanForm(){const[chips,setChips]=useState<string[]>([])const[scanValue,setScanValue]=useState('')constscanValueDebounced=useDebounce(scanValue,300)useEffect(()=>{setChips([...chips,scanValueDebounced])// reset scanValue, should reflect in MuiChipsInput},[scanValueDebounced])functionhandleSubmit(e: React.FormEvent<HTMLFormElement>){e.preventDefault()// ...}return(<formonSubmit={handleSubmit}><MuiChipsInputvalue={chips}onInputChange={(v)=>setScanValue(v)}/><Button>submit</Button></form>)}
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I want to have a scan input, for that I use a debounce on the
onInputChange
, when 300ms passed, I set the chips. But after that, I need to reset the input value (but I do not have control overinputValue
, see: https://github.com/viclafouch/mui-chips-input/blob/main/src/components/TextFieldChip/TextFieldChips.tsx#L66)Describe the solution you'd like
Need to have
inputValue
as props ofMuiChipsInput
.Code usage sample
The text was updated successfully, but these errors were encountered: