Skip to content

Replace react-dates on mobile DateInput with native picker#4343

Draft
amcclain wants to merge 2 commits intodevelopfrom
react-dates
Draft

Replace react-dates on mobile DateInput with native picker#4343
amcclain wants to merge 2 commits intodevelopfrom
react-dates

Conversation

@amcclain
Copy link
Copy Markdown
Member

Summary

  • Replaces the mobile DateInput's internal picker with the browser's native <input type="date">, removing the abandoned react-dates dependency (last release Jan 2020, React peer caps at v16, unfixed SASS issue we had been monkey-patching with a copied CSS file).
  • Public DateInput component, HoistInputModel wiring, and the clear-button pattern are unchanged. Breaking removals on DateInputProps: formatString, initialMonth, placeholder, singleDatePickerProps — all documented in the changelog under 💥 Breaking Changes.
  • Eliminates 8 yarn install peer-dep warnings and deletes ~900 lines of copied CSS plus the kit/react-dates/ sub-package.

Toolbox mobile uses only baseline DateInput props (minDate, maxDate, textAlign, valueType); no Toolbox changes required.

Test plan

  • Mobile DateInput in Toolbox FormPage opens the OS-native picker (iOS wheel, Android Material dialog, desktop popover).
  • minDate/maxDate constraints enforced via native UI and on programmatic commit; out-of-range values reset to null.
  • enableClear button clears value and does not reopen the OS picker.
  • valueType: 'localDate' round-trips correctly; valueType: 'date' (default) unchanged.
  • yarn install no longer emits react-dates-related peer warnings.

Hoist P/R Checklist

  • Caught up with develop branch as of last change.
  • Added CHANGELOG entry (under 💥 Breaking Changes for 85.0.0-SNAPSHOT).
  • Reviewed for breaking changes; please apply breaking-change label.
  • Updated doc comments / prop-types (DateInputProps TSDoc refreshed, kit/README.md + docs/test-automation.md updated).
  • Reviewed and tested on Mobile.
  • Created Toolbox branch / P/R, or determined not required — not required; verified Toolbox uses only unchanged props.

Generated with Claude Opus 4.7 (1M context)

amcclain and others added 2 commits April 18, 2026 08:50
…="date">

The react-dates library was last released in January 2020 and is effectively abandoned. Its React peer dependency caps at v16, generating ~8 yarn install warnings against our React 18 runtime, and the library won't fix known SASS/darken() issues (hence our copied datepicker.css monkey-patch).

Usage was narrow - only the mobile DateInput, and only SingleDatePicker. Swapped the internal picker for the browser's native <input type="date">, which delivers the OS-native date UI (wheel on iOS, Material dialog on Android, popover on desktop) with no library surface. Kept the HoistInputModel-backed DateInput component, its public API (value, min/max, valueType, enableClear, icons, textAlign), and the clear-button pattern from TextInput.

Breaking removals (no downstream usage found in Toolbox): formatString, initialMonth, placeholder, singleDatePickerProps. Also deleted kit/react-dates/ and the copied datepicker.css. Apps with custom SCSS targeting the old react-dates class names should clean those up - noted in the changelog.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant