adobe/react-spectrum

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

Open

#7,756 创建于 2025年2月11日

在 GitHub 查看
 (10 评论) (7 反应) (0 负责人)TypeScript (1,500 fork)auto 404
DatePickergood first issue

仓库指标

Star
 (15,634 star)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南