DatePicker popup TimeField collapses when rendered inside Form

Đang mở
#10,899 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Sufiyan-MSA đang làm issue này rồi.

Từ ngày 1/11/2026.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
css, react, typescript
Lĩnh vực
design, frontend

Hướng nghiên cứu

The bug sits where Spectrum's DatePicker popup TimeField picks up React Aria's FormContext and applies grid-template-columns: subgrid. Start by reproducing with the StackBlitz linked in the issue, then check the computed grid styles on the popup's parent flex container. Done means the time input keeps its full width inside a Form with no change in behaviour outside one.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Provide a general summary of the issue here

When a time-enabled Spectrum 2 DatePicker is rendered inside Spectrum’s Form, the time input in its calendar popup collapses, clipping the time segments.

The same picker renders its popup time input correctly outside Form.

Image
🤔 Expected Behavior?

The popup’s time input should remain wide enough to display and edit all time segments, regardless of whether the DatePicker is inside a Form.

😯 Current Behavior

The time input shrinks and is not wide enough to interact with properly.

💁 Possible Solution

The popup TimeField appears to inherit React Aria’s FormContext. Spectrum uses the presence of this context to enable grid-template-columns: subgrid.

However, the popup TimeField’s immediate parent is a flex container rather than the Form’s grid. Its computed grid-template-columns is none, and the input collapses to its minimum width.

🔦 Context

This affects a form containing date pickers. The date fields themselves fill the form correctly, but the time inputs are clipped and difficult to use.

🖥️ Steps to Reproduce

https://stackblitz.com/edit/yn2buesf?file=src%2FExample.tsx

  1. Open the page
  2. Open the calendar popup and observe that the Time input is collapsed
  3. Close the popup and replace the surrounding <Form> with <div>, leaving the picker unchanged
  4. Open the popup again. The Time input renders at its normal width
Version

@react-spectrum/s2 1.8.2

What browsers are you seeing the problem on?

Chrome

If other, please specify.

No response

What operating system are you using?

macOS

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Ngôn ngữ chính
TypeScript
Star
16k
Fork
1.6k
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
41

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của adobe/react-spectrum

Tất cả issue của adobe/react-spectrum

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.