Skip to content

Commit

Permalink
fix: ariaInvalid doesnt work
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianMaliszewski authored and johnrazeur committed Nov 6, 2023
1 parent 5704ada commit c04c57a
Show file tree
Hide file tree
Showing 3 changed files with 2,668 additions and 2,009 deletions.
25 changes: 12 additions & 13 deletions packages/form/src/components/DateField/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export const DateField = <TFieldValues extends FieldValues>({
locale={locale}
required={required}
onChange={(val: DateExtends | null) => {
if (val) {
if (val && val instanceof Date) {
onChange?.(val)
const newDate = parseDate(val)
if (isEmpty(field.value as Date)) {
Expand All @@ -111,21 +111,20 @@ export const DateField = <TFieldValues extends FieldValues>({
error={getError({ minDate, maxDate, label }, error)}
disabled={disabled}
autoFocus={autoFocus}
excludeDates={excludeDates}
data-testid={dataTestId}
excludeDates={excludeDates}
data-testid={dataTestId}
startDate={
selectsRange
? (input.value as [Date | null, Date | null])[0]
: undefined
}
endDate={
selectsRange
? (input.value as [Date | null, Date | null])[1]
: undefined
}
selectsRange
? (field.value as [Date | null, Date | null])[0]
: undefined
}
endDate={
selectsRange
? (field.value as [Date | null, Date | null])[1]
: undefined
}
/>
)}
>>>>>>> 3bfea1c6 (refactor(form): migrate to react hook form)
/>
)
}
1 change: 0 additions & 1 deletion packages/ui/src/components/NumberInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ export const NumberInput = ({
role="status"
>
<StyledInput
aria-invalid={!!error}
disabled={disabled}
name={name}
onBlur={handleOnBlur}
Expand Down
Loading

0 comments on commit c04c57a

Please sign in to comment.