Skip to content

Commit

Permalink
adding _error passed into entryWrapper and removing ariaDescribedBy
Browse files Browse the repository at this point in the history
  • Loading branch information
hclarkEnq committed Oct 24, 2024
1 parent 43172e5 commit 3946f8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export const DatePickerInput = (props: DatePickerProps) => {
required={props.required}
error={_error}>
{props.defaultValue && (
<InternalDatePicker {...props} onBlur={checkValidity} defaultValue={intialDefault} />
<InternalDatePicker {...props} error={_error} onBlur={checkValidity} defaultValue={intialDefault} />
)}
{!props.defaultValue && <InternalDatePicker {...props} onBlur={checkValidity} />}
{!props.defaultValue && <InternalDatePicker {...props} error={_error} onBlur={checkValidity} />}
</EntryWrapper>
);
};
Expand All @@ -87,7 +87,7 @@ const InternalDatePicker = ({
disabled = false,
disableFutureDates = false,
label,
errorMessage
error
}: DatePickerProps) => {
const toggleCalendar = label ? `${label} toggle calendar` : EN_US.toggleCalendar;
const getCurrentLocalDate = () => {
Expand All @@ -111,8 +111,7 @@ const InternalDatePicker = ({
onKeyDown={handleKeyDown}
onChange={handleOnChange(onChange)}
className={classNames(className)}
validationStatus={errorMessage ? 'error' : undefined}
aria-describedby={errorMessage ? `${errorMessage}-message` : undefined}
validationStatus={error ? 'error' : undefined}
name={name}
disabled={disabled}
defaultValue={defaultValue || undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const SingleSelect = ({
{...inputProps}
id={id}
validationStatus={error ? 'error' : undefined}
aria-describedby={error ? `${error}-message` : undefined}
name={inputProps.name ?? id}
defaultValue={value?.value}
placeholder="-Select-"
Expand Down

0 comments on commit 3946f8b

Please sign in to comment.