#Multi-Select Doesn't open when value is selected - solved

38 messages · Page 1 of 1 (latest)

dull quiver
dull quiver
#

I'll try updating

#

Didn't work still same issue

sick oar
sick oar
#
<MultiSelect
     
data={[
 { value: "react", label: "React" },
 { value: "ng", label: "Angular" }, 
 { value: "svelte", label: "Svelte" },  
 { value: "vue", label: "Vue" }, 
 { value: "riot", label: "Riot" },
 { value: "next", label: "Next.js" }, 
 { value: "blitz", label: "Blitz.js" }
 ]}
 {...form.getInputProps("outdistrict")}
 />

note the one that the form will receive is the value and the label is what the user will see

dull quiver
#

problem is with Mantine's useform behaviour i presume

sick oar
dull quiver
#

are you supposed to use "" or []

#

as it's array

sick oar
# dull quiver

you have multiple values to select and you want to select many. So it should be array!

dull quiver
#

I had type as an array it didn't work I changed it to strings now back to array

sick oar
#

I think you should give it [''] or it will give error later.

dull quiver
#

i did right now

#

didn't work

#

i removed user?.outdistrict too

#

still not working

sick oar
#

is your user?.outdistrict array type?

dull quiver
#

prisma scheme:

#

I guess my case might be unique

#

thanks for trying to help @sick oar

sick oar
#

No problem. I dont think the issue with the select it self though. Try to check around it. Maybe display outside everything label or others. So you can find if it still have the issue or not.

dull quiver
#

i removed {...form.getInputProps("outdistrict")}

#

and it still not working to be honest

#

super weird

dull quiver
#

@sick oar

#

I FOUND THE PROBLEM

#

🤣 🤣 🤣 🤣 🤣 🤣 🤣 🤣 🤣 🤣 🤣 🤣 🤣

#

I changed label to div

#

and it started working

#

for some weird reason basically if you place MultiSelect inside <label> It will not work as expected</label>

#

Multi-Select Doesn't open when value is selected - solved