Skip to content

Commit

Permalink
Merge pull request #767 from RockefellerArchiveCenter/development
Browse files Browse the repository at this point in the history
Fix implementation of aria-describedby on datepicker
  • Loading branch information
helrond authored Dec 4, 2024
2 parents fe46999 + cf607cd commit df898db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Inputs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import DatePicker from 'react-datepicker'
import {useSelect} from 'downshift'
import MaterialIcon from '../MaterialIcon'
import classnames from 'classnames'
import { t } from '@lingui/macro'
import "react-datepicker/dist/react-datepicker.css"
import './styles.scss'

Expand Down Expand Up @@ -68,6 +67,7 @@ export const DateInput = ({className, defaultDate, handleChange, helpText, id, l
<>
<label htmlFor={id}>{label}</label>
<DatePicker
ariaDescribedBy={helpText && `desc-${id}`}
className={className || 'dp__wrapper'}
selected={startDate}
showTimeSelect='true'
Expand All @@ -76,7 +76,7 @@ export const DateInput = ({className, defaultDate, handleChange, helpText, id, l
id={id}
{...props}>
</DatePicker>
{helpText && <p className='input__help-text' aria-describedby={`desc-${id}`}>{helpText}</p>}
{helpText && <p className='input__help-text' id={`desc-${id}`}>{helpText}</p>}
</>
)}

Expand Down

0 comments on commit df898db

Please sign in to comment.