Skip to content

Commit 786ae5d

Browse files
committed
chore: add review changes
1 parent ada5792 commit 786ae5d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

1st-gen/packages/overlay/src/overlay-trigger-directive.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export class OverlayTriggerDirective extends SlottableRequestDirective {
9090
this.target = part.element as HTMLElement;
9191
newTarget = true;
9292
}
93-
this.listenerHost = this.target;
9493
if (newTarget || newStrategy) {
9594
this.strategy?.abort();
9695
this.strategy = new strategies[
@@ -136,6 +135,15 @@ export class OverlayTriggerDirective extends SlottableRequestDirective {
136135
insertionEl.insertAdjacentElement(where, this.overlay);
137136
}
138137
}
138+
139+
override reconnected(): void {
140+
// Do not re-initialize until an overlay instance exists.
141+
// The overlay-ready callback is responsible for wiring the initial listener.
142+
if (!this.overlay) {
143+
return;
144+
}
145+
this.init();
146+
}
139147
}
140148

141149
export const trigger = directive(OverlayTriggerDirective);

0 commit comments

Comments
 (0)