Skip to content

Commit 2ab3ff2

Browse files
fix(datetime): multiple month selected and flakiness display
1 parent 34effe8 commit 2ab3ff2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

core/src/components/datetime/datetime.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,9 @@ export class Datetime implements ComponentInterface {
10861086

10871087
connectedCallback() {
10881088
this.clearFocusVisible = startFocusVisible(this.el).destroy;
1089+
this.loadTimeout = setTimeout(() => {
1090+
this.ensureReadyIfVisible();
1091+
}, 100);
10891092
}
10901093

10911094
disconnectedCallback() {
@@ -1095,6 +1098,7 @@ export class Datetime implements ComponentInterface {
10951098
}
10961099
if (this.loadTimeout) {
10971100
clearTimeout(this.loadTimeout);
1101+
this.loadTimeout = undefined;
10981102
}
10991103
}
11001104

core/src/components/picker-column/picker-column.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ComponentInterface, EventEmitter } from '@stencil/core';
22
import { Component, Element, Event, Host, Method, Prop, State, Watch, h } from '@stencil/core';
33
import { doc } from '@utils/browser';
4-
import { getElementRoot, raf } from '@utils/helpers';
4+
import { raf } from '@utils/helpers';
55
import { hapticSelectionChanged, hapticSelectionEnd, hapticSelectionStart } from '@utils/native/haptic';
66
import { isPlatform } from '@utils/platform';
77
import { createColorClasses } from '@utils/theme';
@@ -122,9 +122,7 @@ export class PickerColumn implements ComponentInterface {
122122
* Because this initial call to scrollActiveItemIntoView has to fire before
123123
* the scroll listener is set up, we need to manage the active class manually.
124124
*/
125-
const oldActive = getElementRoot(el).querySelector<HTMLIonPickerColumnOptionElement>(
126-
`.${PICKER_ITEM_ACTIVE_CLASS}`
127-
);
125+
const oldActive = el.querySelector<HTMLIonPickerColumnOptionElement>(`.${PICKER_ITEM_ACTIVE_CLASS}`);
128126
if (oldActive) {
129127
this.setPickerItemActiveState(oldActive, false);
130128
}

0 commit comments

Comments
 (0)