Replies: 1 comment 1 reply
-
Doing the following seems to do the job, but its not ideal. value={theme ? theme : undefined} Plus, I wanted to spread some awareness since I don't know if this is the intended behaviour |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone, I'm experiencing a peculiar issue involving the
<Select>
input component in conjunction with NextJS Server Actions. For some unknown reason, when thevalue
prop of the Select input is an empty string (''
) , it arrives as the first<SelectItem>
on the server action (in this case'light'
).The frontend
The server action
The output of the log is:
I don't know for sure if this is a shadcn/ui issue, a NextJS issue, or something else. Setting the value to
undefined
does appear to correctly display the selected theme on the server action. The challenge here is that since some of my<Select>
components are not marked asrequired
, I need the value to remain an empty string when it arrives at the server action.I appreciate any leads, thanks.
Beta Was this translation helpful? Give feedback.
All reactions