You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Dispatch a custom event that can be listened to by the popover target.
105
105
// Mostly used for UUIButton.
106
-
this.#target?.dispatchEvent(
106
+
this.#targetElement?.dispatchEvent(
107
107
newCustomEvent('uui-popover-before-toggle',{
108
108
bubbles: false,
109
109
composed: false,
@@ -129,13 +129,17 @@ export class UUIPopoverContainerElement extends LitElement {
129
129
#initUpdate =()=>{
130
130
this._actualPlacement=this._placement;
131
131
this.style.opacity='0';
132
+
// 3 iterations makes the popover flip back to the initial position if theres no space for it on either side.
132
133
this.#updatePosition(3);
133
134
};
134
135
135
136
#updatePosition =(iteration: number)=>{
136
137
this.#updatePadding();
138
+
139
+
// Iterations makes sure that we don't overflow the stack.
140
+
// That could happen if the is no space for the popover on either side, which without iterations, would make it flip back and forth until the stack overflows
0 commit comments