Open mauron85 opened 5 months ago
I think this seems fine on the surface, we make use of it in ComboBox so that select
is exposed https://github.com/adobe/react-spectrum/pull/4039
I am a bit curious what react-final-form
will do with those, maybe they should change to Element?
We'll want to be careful about how far up the chain we expose it, and I imagine that most of our components would have this issue? is this the only one you're using?
so far this is the only component i have problems writing form wrapper for it. other use just strings so wrapper is much simpler (no need to format from datecalendar and back to string)
Provide a general summary of the feature here
Currently DateRangePicker has props of type DateRangePickerProps which extends AriaDateRangePickerProps -> AriaDatePickerBaseProps -> DatePickerBase -> DateFieldBase which finally extends FocusableProps
DateFieldBase is not allowing FocusableProps to set custom Target element type (it's always Element)
This prevents using use of DateRangePicker with libraries like react-final-form, which has onBlur, onFocus event target set as HTMLElement.
Result in type error during compilation:
๐ค Expected Behavior?
DateRangePicker, down to DateFieldBase should allow override default Target for FocusableProps.
https://github.com/adobe/react-spectrum/blob/87dbb748cbfd9bd6f53183221b8e2ef96defbfc3/packages/react-aria-components/src/DatePicker.tsx#L156C10-L156C25
๐ฏ Current Behavior
DateFieldBase doesn't allow to specify target element element type (it's always typeof Element)
๐ Possible Solution
๐ฆ Context
Creating form wrapper for DateRangePicker using react-final-form is not possible because react-final-form expects onBlur, onFocus event's target to extend HTMLElement:
๐ป Examples
๐งข Your Company/Team
No response
๐ท Tracking Issue
No response