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

未關閉
#30,571 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
42/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
angular, ios, typescript
領域
frontend, mobile

研究方向

從 ion-datetime 元件的進入點開始,在 iOS 上 ionChange 期間設定 disabled 時重現所描述的月份變更。將行為與 Android 或 Web 進行比較,然後驗證在載入轉換期間選取某一天不再返回上一個月和日期。

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
TypeScript
星號
52.8k
分支
13.3k
平均合併
3 天 1 小時
30 天內合併 PR
86

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ionic-team/ionic-framework 的其他 Issue

查看 ionic-team/ionic-framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。