react-spectrum icon indicating copy to clipboard operation
react-spectrum copied to clipboard

Unable to pass ref to Datepicker [react-aria-components]

Open wmodden opened this issue 10 months ago โ€ข 9 comments

Provide a general summary of the issue here

I have a custom Datepicker component that I'm integrating with react-hook-form. I was wondering which component should received the ref (passed by forwardRef), I need to do so since react hook form uses this ref to focus an element on error (think a form submission that has client validation)

I've tried with the DatePicker and DateInput but no luck.

๐Ÿค” Expected Behavior?

Ref should be received by the DatePicker or DateInput component.

๐Ÿ˜ฏ Current Behavior

Looks like the ref is not being received by the mentioned react-aria-components.

๐Ÿ’ Possible Solution

No response

๐Ÿ”ฆ Context

No response

๐Ÿ–ฅ๏ธ Steps to Reproduce

You can use the documentation https://react-spectrum.adobe.com/react-aria/DatePicker.html

Version

1.5.0

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macos sequoia

๐Ÿงข Your Company/Team

No response

๐Ÿ•ท Tracking Issue

No response

wmodden avatar Feb 11 '25 02:02 wmodden