Empty string passed to getElementById().
Unanswered
Swedish Lapphund posted this in #help-forum
Swedish LapphundOP
Whenever I do the following
8 Replies
Swedish LapphundOP
I am not sure why it does that though...
<Autocomplete
id="disabilities"
fullWidth
multiple
options={getDisabilitiesOptions()}
value={profileDisabilities}
onChange={(_, selectedDisabilities) => {
setProfileDisabilities(selectedDisabilities);
}}
disableCloseOnSelect
renderTags={(tagValue, getTagProps) => {
return tagValue.map((option, index) => (
<Chip {...getTagProps({ index })} key={option} label={option} />
))
}}
renderInput={(params) => (
<TextField
{...params}
label="Disabilities"
placeholder="Select Disabilities"
/>
)}
/>
when I do it with a value:
notice how it goes from panel to main, its like a bool is being inverted lol
getDisabilitiesOptions()
returns a string[]
Hi, the warning happens because the
getDisabilitiesOptions()
returns an array of objects containing key
and value
, it's okay. The problem lies in the onChange
function; you should set the key of the disability
not the whole object.