Skip to content

Commit

Permalink
Update services/app-web/src/components/FilterAccordion/FilterDateRang…
Browse files Browse the repository at this point in the history
…e/FilterDateRange.tsx

Co-authored-by: haworku <haworku@users.noreply.github.com>
  • Loading branch information
JasonLin0991 and haworku authored Nov 7, 2023
1 parent b780d84 commit fd90a62
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ import { dayjs } from '../../../common-code/dateHelpers/dayjs'
import { PoliteErrorMessage } from '../../PoliteErrorMessage'

/**
* This component uses a modified DatePicker component located in ./_DatePicker. This was done because we needed a ref to
* the DatePicker input for clearing input values using the clear filter button on the filter accordion, input
* validations, and displaying error messages on each DatePicker input. This component is essentially recreating the
* DateRangePicker with the modification to display error messages on the individual DatePicker inputs.
*
* We will no loner need to a modified DatePicker when:
* This component recreates the @trussworks/react-uswds DateRangePicker with a modification to validate and clear individual DatePicker inputs. In addition, a modified version of the @trussworks/react-uswds DatePicker component is used, located in ./_DatePicker.
*This was done to unlock ability for the user to use date inputs as controlled components. There are two current use cases:
* clear both input values at once (such as when using the clear filter button on the filter accordion)
* enable validations and displaying error messages on each input
* We will no longer need to a modified DatePicker when:
* - DatePicker is updated to surface a ref to the input
* - DateRangePicker adds the option to display errors on each DatePicker input
*/
Expand Down

0 comments on commit fd90a62

Please sign in to comment.