#required on Select does nothing

6 messages · Page 1 of 1 (latest)

rustic herald
#

I have simple select component:

<Select
    placeholder="Choose a topic"
    data={loaderData.userTopics.map((topic) => topic.name)}
    name="topicName"
    required
/>

The required prop does show up in the HTML:

<input class="m-8fb7ebe7 mantine-Input-input mantine-Select-input" data-variant="default" placeholder="Choose a topic" readonly="" aria-haspopup="listbox" autocomplete="off" required="" aria-invalid="false" id="mantine-sfzdeby95" value="" aria-controls="mantine-lbus63ecf">

But it does not work. When I submit the form without selecting anything in the form, it just sends an empty string for topicName. Am I doing something wrong?

wary zodiac
#

you need to setup validation yourself

rustic herald
wary zodiac
#

i am not certain, i do not think mantine form submission works exactly like native forms

woeful cosmos