Skip to content

Commit

Permalink
fix: remove pattern prop on datepickers
Browse files Browse the repository at this point in the history
that was causing some form validation to prevent submission, since the underlying value does not fit the pattern.
  • Loading branch information
karrui committed Nov 8, 2023
1 parent 6869ee8 commit 467e645
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 2 additions & 8 deletions react/src/DatePicker/components/DatePickerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ export const DatePickerInput = forwardRef<{}, 'input'>((_props, ref) => {
{hasMounted ? (
<Input
size={size}
inputMode="numeric" // Nudge Android mobile keyboard to be numeric
pattern="\d*" // Nudge numeric keyboard on iOS Safari.
inputMode="numeric" // Nudge Android mobile keyboard to be numeric.
as={ReactInputMask}
mask="99/99/9999"
value={internalInputValue}
Expand All @@ -70,12 +69,7 @@ export const DatePickerInput = forwardRef<{}, 'input'>((_props, ref) => {
isReadOnly={fcProps.isReadOnly || !allowManualInput}
/>
) : (
<Input
pattern="\d*"
size={size}
inputMode="numeric"
placeholder={placeholder}
/>
<Input size={size} inputMode="numeric" placeholder={placeholder} />
)}
<InputRightAddon p={0} border="none">
<CalendarButton />
Expand Down
4 changes: 0 additions & 4 deletions react/src/DateRangePicker/components/DateRangePickerInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export const DateRangePickerInput = forwardRef<{}, 'input'>((_props, ref) => {
variant="unstyled"
aria-label="Start date of range"
inputMode="numeric" // Nudge Android mobile keyboard to be numeric
pattern="\d*" // Nudge numeric keyboard on iOS Safari.
sx={styles.field}
width="6rem"
as={ReactInputMask}
Expand All @@ -95,7 +94,6 @@ export const DateRangePickerInput = forwardRef<{}, 'input'>((_props, ref) => {
size={size}
variant="unstyled"
inputMode="numeric"
pattern="\d*"
placeholder={placeholder}
sx={styles.field}
width="6rem"
Expand All @@ -108,7 +106,6 @@ export const DateRangePickerInput = forwardRef<{}, 'input'>((_props, ref) => {
size={size}
aria-label="Start date of range"
inputMode="numeric" // Nudge Android mobile keyboard to be numeric
pattern="\d*" // Nudge numeric keyboard on iOS Safari.
sx={styles.field}
width="6rem"
as={ReactInputMask}
Expand All @@ -128,7 +125,6 @@ export const DateRangePickerInput = forwardRef<{}, 'input'>((_props, ref) => {
size={size}
variant="unstyled"
inputMode="numeric"
pattern="\d*"
placeholder={placeholder}
sx={styles.field}
width="6rem"
Expand Down

0 comments on commit 467e645

Please sign in to comment.