Datepicker is not allowing clearing date
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
- 45/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 từ component Datepicker và theo dõi cách nút xóa của nó gọi onSelectedDateChanged. Xác nhận các đối số hiện tại của callback và cách giá trị ban đầu được khôi phục, sau đó xác định hành vi của thao tác xóa được mô tả trong issue và kiểm tra rằng việc chọn ngày vẫn hoạt động bình thường. Công việc được hoàn tất khi người dùng có thể xóa một ngày hiện có và phía sử dụng có thể phân biệt việc xóa với việc chọn ngày.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Summary
Currently, the Datepicker component in Flowbite-React allows users to select a date, but lacks a fully functional clear button that can reset the date to null. The clear button only resets the date to the original value. I propose adding a flag like isClearAction to the onSelectedDateChanged callback function. This flag would be set to true when the clear button is used, allowing developers to explicitly handle the clear action by setting the date to null if desired.
Example implementation:
<Controller
control={control}
name="birthday"
render={({ field: { onChange, value } }) => (
<Datepicker
onSelectedDateChanged={(date, isClear) => {
if (isClear) {
onChange(null); // Explicitly handle clear action
return;
}
onChange(date); // Handle date change normally
}}
placeholder="Please enter date"
ref={elementRef}
value={value ? moment(value).format('YYYY-MM-DD') : ''}
/>
)}
/>
This feature would enable developers to easily implement scenarios where a user might need to completely remove a previously selected date.
Context
In various applications, especially in forms involving date entries like event planning, user registrations, or bookings, having the capability to clear a date completely is crucial. Currently, without this feature, users of our application cannot remove a date once selected; they can only change it. This limitation affects the flexibility and user experience of the application. By implementing this feature, we will provide a more robust and intuitive interaction for users who need to reset their date selections entirely.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.1k
- Fork
- 502
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của themesberg/flowbite-react
-
fix(Carousel): can't give dynamic children to CarouselCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở:bug: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
themesberg/flowbite-react#1469 · 1 bình luận ·
-
Pagination is broken if there is only one pageCó thể đã có người làm @Mukilan1600 đã nhận 1018 ngày trước. Đang mở:bug: bug confirmed good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
themesberg/flowbite-react#1048 · 7 bình luận · 1 reaction ·
-
:books: documentation help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
themesberg/flowbite-react#1696 · 2 bình luận ·
-
Add a QRCode componentĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
themesberg/flowbite-react#1693 ·
-
NavbarCollapse closes when toggling a MegaMenuDropdown on mobileCó thể làm lại được @sarthak-11231 đã nhận 42 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
themesberg/flowbite-react#1686 · 2 bình luận ·
Tất cả issue của themesberg/flowbite-react
Issue tương tự
-
[Text] Add Reading Time & Word Count Estimator for Reflection Notes in src/lib/text/reading-time.tsĐang mởarea:core beginner-friendly community contributions-welcome difficulty:easy enhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[fullsend] E2E: scorecard — filecheck GitLab entity metrics unavailable due to initialDelay timingĐang mởe2e-failure ready-to-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
redhat-developer/rhdh-plugin-export-overlays#4698 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
devswha/herdr-web-ui#2884 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
b:minor bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
software-mansion/argent#1771 ·
Maintainer thường phản hồi trong vòng 1 ngày