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 摘要。