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

Offen
#30,571 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
angular, ios, typescript
Bereich
frontend, mobile

Rechercherichtung

Beginne am Einstiegspunkt der ion-datetime-Komponente und reproduziere den beschriebenen Monatswechsel, während disabled während ionChange auf iOS gesetzt ist. Vergleiche das Verhalten mit Android oder dem Web und überprüfe anschließend, dass die Auswahl eines Tages während des Lad Übergangs nicht mehr zum vorherigen Monat und Datum zurückkehrt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
TypeScript
Sterne
52.8k
Forks
13.3k
Ø Merge
3 T. 1 Std.
Gemergte PRs (30 T.)
86

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus ionic-team/ionic-framework

Alle Issues in ionic-team/ionic-framework

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.