Skip to content

Commit d458c0b

Browse files
committed
chore: update
1 parent acc22bb commit d458c0b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/main/src/DatePicker.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,9 @@ class DatePicker extends DateComponentBase implements IFormInputElement {
372372
@property()
373373
_calendarCurrentPicker: Picker = "day";
374374

375+
@property({ type: Boolean })
376+
_shouldRenderPopover = false;
377+
375378
liveValue?: string;
376379

377380
isLiveUpdate?: boolean;
@@ -474,6 +477,9 @@ class DatePicker extends DateComponentBase implements IFormInputElement {
474477
this.value = this.normalizeFormattedValue(this.value) || this.value;
475478
}
476479
this.liveValue = this.value;
480+
if (this.open) {
481+
this._shouldRenderPopover = true; // render the popover only when the picker is open (but never remove it from DOM once rendered)
482+
}
477483
}
478484

479485
/**

packages/main/src/DatePickerPopoverTemplate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default function DatePickerPopoverTemplate(this: DatePicker, hooks?: { he
2020
const footer = hooks?.footer || defaultFooter;
2121
const initialFocus = hooks?.initialFocus;
2222

23-
if (!this.open) {
23+
if (!this._shouldRenderPopover) {
2424
return;
2525
}
2626

0 commit comments

Comments
 (0)