Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Calendar] Support ref as prop and fix date handling edge cases

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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với các entry point của các component Calendar, DatePicker và RangePicker, đồng thời kiểm tra prop types và các luồng xử lý ngày tháng của chúng. Xem xét việc hỗ trợ ref, validation đối với ngày trong tương lai, cleanup mouseup listener, giá trị mặc định của single mode trong Calendar và việc phát hiện input format theo các cải tiến đã nêu. Được xem là hoàn thành khi behavior bị ảnh hưởng có thể cấu hình hoặc đã được sửa trong cả ba component, đồng thời vẫn giữ nguyên các pattern hiện có của design system.

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

Mô tả

component triage

Summary

Improvements to the Calendar, DatePicker, and RangePicker components to fix patterns and improve flexibility.

Improvements

1. No ref prop support on Calendar, DatePicker, or RangePicker

None of the three exported components accept ref as a prop, inconsistent with the rest of the design system.

2. Hardcoded future date restriction in DatePicker

DatePicker input validation has dayjs(date).isSameOrBefore(dayjs()) hardcoded, preventing selection of future dates. This should be configurable or removed.

4. Manual event listener management in DatePicker

DatePicker manually manages mouseup event listeners via document.addEventListener/removeEventListener. This could be simplified using the Popover's own onOpenChange interaction model or a useEffect cleanup pattern.

5. mode='single' hardcoded in Calendar

The Calendar component sets mode='single' by default but also spreads ...props after, which allows override. The default should be documented or the prop should be explicit in the type.

6. DatePicker input format detection is fragile

handleInputChange guesses the date format based on separator character (/ or -). This can conflict with the dateFormat prop if the user specifies a different format.

Moved to Cross-Cutting Issues

The following items have been moved to cross-cutting issues that address them across all components:

  • Remove !important declarations (#678)
Ngôn ngữ chính
TypeScript
Star
70
Fork
13
Merge trung bình
4 ngày 6 giờ
Pull request đã merge (30 ngày)
10

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

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 raystack/apsara

Tất cả issue của raystack/apsara

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.