ionic-team / ionic-team/ionic-framework

bug: datetime should clamp within the min/max when the min or max changes

Đang mở
#29,042 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
package: core type: bug
Ngôn ngữ chính
TypeScript
Star
52.7k
Fork
13.3k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
51

Mô tả

### Prerequisites

- [X] I have read the [Contributing Guidelines](https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#creating-an-issue).
- [X] I agree to follow the [Code of Conduct](https://ionicframework.com/code-of-conduct).
- [X] I have searched for [existing issues](https://github.com/ionic-team/ionic-framework/issues) that already report this problem, without success.

### Ionic Framework Version

v7.x

### Current Behavior

Hi @liamdebeasi, I think I finally found a bug that is not intended behavior. 😂

If the max date is changed to a month more than one month previous to the currently viewed month, the navigation arrows are disabled and the month cannot be scrolled. I can't imagine this is intended behavior, as the user can no longer get to perfectly valid enabled dates.

### Expected Behavior

Navigation to previous months should be possible if the currently viewed month is more than one month after the max date.

### Steps to Reproduce

1. Run the code production.
2. Scroll forward two months to June 2022.
3. Click the "Set min = 2022-04-27" button. The navigation arrows dim and all month scrolling is disabled.
4. Click the "Set min = 2022-06-10" button. Navigation is re-enabled.
5. Scroll back to May 2022.
6. Click the "Set min = 2022-04-27" button. The previous navigation arrow remains enabled dim you can scroll to April.

### Code Reproduction URL

https://stackblitz.com/edit/mwzxtr?file=src%2Fcomponents%2FExample.vue

### Ionic Info

Ionic:

Ionic CLI : 7.2.0 (app/node_modules/.pnpm/@ionic+cli@7.2.0/node_modules/@ionic/cli)

Capacitor:

Capacitor CLI : 5.7.0
@capacitor/android : 5.7.0 (app/node_modules/.pnpm/@capacitor+android@5.7.0_@capacitor+core@5.7.0/node_modules/@capacitor/android)
@capacitor/core : 5.7.0 (app/node_modules/.pnpm/@capacitor+core@5.7.0/node_modules/@capacitor/core)
@capacitor/ios : 5.7.0 (app/node_modules/.pnpm/@capacitor+ios@5.7.0_@capacitor+core@5.7.0/node_modules/@capacitor/ios)

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v21.4.0 (pnpm/nodejs/21.4.0/bin/node)
npm : 10.2.4
OS : macOS Unknown

### Additional Information

_No response_

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

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

Hướng nghiên cứu

Run the StackBlitz reproduction at https://stackblitz.com/edit/mwzxtr?file=src%2Fcomponents%2FExample.vue and reproduce the date-picker behavior after changing the min date. Compare the navigation state when the visible month is before or after the changed limit. Done means navigation remains available for valid enabled dates in both sequences described by the issue.

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

Đánh giá

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

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.