Skip to content

Commit bf4ca9e

Browse files
committed
* popover: refactor panel initialization by extracting the layout call into a separate method, improving code readability and maintainability.
1 parent b42c133 commit bf4ca9e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/popover/src/vanilla/popover.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ export class Popover<O extends PopoverOptions = PopoverOptions, E extends Compon
443443
panel.render(panelOptions);
444444
} else {
445445
panel = new PopoverPanel(targetElement, panelOptions);
446-
panel.on('inited', () => this.layout());
446+
panel.on('inited', this._handlePanelInited);
447447
}
448448
this._panel = panel;
449449
} else {
@@ -479,6 +479,10 @@ export class Popover<O extends PopoverOptions = PopoverOptions, E extends Compon
479479
}, delay);
480480
}
481481

482+
protected _handlePanelInited = () => {
483+
this.layout();
484+
};
485+
482486
protected _clearDelayHide() {
483487
if (this._hideTimer) {
484488
clearTimeout(this._hideTimer);

0 commit comments

Comments
 (0)