Open drokbers opened 8 months ago
Hi there, thanks for bring this up. I do believe required
is passed - the issue is that the default <Datepicker>
state is always the current date, so the browser interprets it as filled immediately. Still a bug of course.
Hi there, thanks for bring this up. I do believe
required
is passed - the issue is that the default<Datepicker>
state is always the current date, so the browser interprets it as filled immediately. Still a bug of course.
I would head up to https://github.com/themesberg/flowbite-react/pull/1190 and see if these breaking changes might be related and fix this too, not sure.
Hi there, thanks for bring this up. I do believe
required
is passed - the issue is that the default<Datepicker>
state is always the current date, so the browser interprets it as filled immediately. Still a bug of course.
Yes, but I cannot do anything to prevent the submit process when the user does not select any date. Thank you for looking into this.
This also ties in with a placeholder for the Datepicker if no date is currently selected...
<Datepicker
placeholder="Please select date of birth"
...
/>
Summary
I'm using date picker like the one below but it's never required. Users can submit the form with an empty datepicker, and additionally, when a field is marked as required in an input field, a red asterisk (*) appears above it, but it doesn't appear above the datepicker.
<Datepicker required title="Start date" theme={customTheme} showClearButton showTodayButton={false} className="w-1/2" datepicker-format="dd/mm/yyyy" onSelectedDateChanged={handleDateChange("start_date")} value={formattedStartDate} />
Context
I tried in chrome, brave and safari and all has same bug.