#Nextui Select not showing correct data even though selected

11 messages · Page 1 of 1 (latest)

golden olive
#
<Select
    label="Parent Question"
    value={formData.ParentQuestionUUID}
    selectedKeys={formData.ParentQuestionUUID ? [formData.ParentQuestionUUID] : []}
    onChange={(e) => {
        setFormData({ ...formData, ParentQuestionUUID: e.target.value })
        console.log(e.target.value)
    }}
>
    {all_questions
        .sort((a, b) => a.QuestionID - b.QuestionID)
        .map((q) => (
            q.id === question.id ? null : (
                <SelectItem key={q.id} value={q.id}>
                    {q.QuestionID} {q.Name}
                </SelectItem>
            )
        ))}
</Select>
#

it will not show the value that is set inside the SelectItem itself but it does set the value in my database....

#

I know it has access to the question name and QuestionID since it is showing in the dropdown

golden olive
#

when I select an item from the SelectItem list it does have the check next to it and it shows the ID and name but in the visual field it just shows an empty bar...

#

please ping me if anyone knows a solution

agile saddle
#

Which version r u using?

golden olive
#

"@nextui-org/react": "^2.4.6",

#

we already tried that canary stuff on my machine and it gave me alot of errors 🙂

agile saddle
#

canary before 2.4.8?

#

can u share a sandbox

#

a minimal reproducibe example