Empty string passed to getElementById().
Unanswered
Swedish Lapphund posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Swedish LapphundOP
Whenever I do the following
8 Replies
![Avatar](https://cdn.discordapp.com/embed/avatars/4.png)
Swedish LapphundOP
![Image](https://cdn.discordapp.com/attachments/1196260427626192957/1196260718710894642/mwQzTTMaJO.gif?ex=65b6fb9c&is=65a4869c&hm=79cd547374ee461d057922913cc63d1888ed82d5f83c56095a1ebc8e233a0c0e&)
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:
![Image](https://cdn.discordapp.com/attachments/1196260427626192957/1196261015868952637/image.png?ex=65b6fbe3&is=65a486e3&hm=0df5ed37822490405a880fa1dbd81670ad71c3e4c1a7504918fbe356b47f7b04&)
notice how it goes from panel to main, its like a bool is being inverted lol
getDisabilitiesOptions()
returns a string[]
![Avatar](https://cdn.discordapp.com/avatars/706802016109985813/29a666051471b5a1c43e7f439afafd5c.webp?size=256)
Hassib
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.