bug: datetime, ios only, looping between months when disabled is set

Đang mở
#30,571 2 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

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
42/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
angular, ios, typescript
Lĩnh vực
frontend, mobile

Hướng nghiên cứu

Bắt đầu từ điểm vào của component ion-datetime và tái hiện việc thay đổi tháng được mô tả khi disabled được đặt trong ionChange trên iOS. So sánh hành vi với Android hoặc web, sau đó xác minh rằng việc chọn một ngày trong quá trình chuyển tiếp tải không còn quay lại tháng và ngày trước đó.

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

Mô tả

ionitron: needs reproduction

If you set disable in the ion-datetime component, the "old" bug of "change automatically to previous selected month" happens (only on iOS).

Steps to reproduce:

  1. Set a calendar
    <ion-datetime
    #calendar
    presentation="date"
    [firstDayOfWeek]="1"
    [disabled]="loading()"
    (ionChange)="dayChange($event)"
    [(ngModel)]="selectedDate"
    />

  2. selectedDate is null by default

  3. Change to a new month and select a new day.

  4. When ionChange, simply do a call to any process consuming time and set a signal to loading.set(true) before load

This will make datetime to go a previous month.

Changing the selected month and clicking on a new day causes the component to go back to previous month and date, no matter the month. This problem happens on iOS only. I tested on iOS 18.5 (real device) and on iOS 18.4 (emulator).

"@angular/core": "^19.0.0",
"@angular/router": "^19.0.0",
"@capacitor/android": "7.4.0",
"@capacitor/app": "7.0.1",
"@capacitor/core": "^7.4.0",
"@capacitor/device": "^7.0.1",
"@capacitor/haptics": "7.0.1",
"@capacitor/keyboard": "7.0.1",
"@capacitor/preferences": "^7.0.1",
"@capacitor/push-notifications": "^7.0.1",
"@capacitor/splash-screen": "^7.0.1",
"@capacitor/status-bar": "7.0.1",
"@capawesome/capacitor-android-edge-to-edge-support": "^7.2.2",

Works fine in Android/web.

As a workaround, I set a div with transparency over the calendar to emulate the disabled state.

Ngôn ngữ chính
TypeScript
Star
52.8k
Fork
13.3k
Merge trung bình
3 ngày 1 giờ
Pull request đã merge (30 ngày)
86

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 ionic-team/ionic-framework

Tất cả issue của ionic-team/ionic-framework

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.