Skip to content

Commit b4d79a6

Browse files
jcfrancobenelan
authored andcommitted
fix: fix memory leak caused when disconnecting floating-ui (#12107)
**Related Issue:** #10648 ## Summary Addresses a memory leak where floating-ui cleanup was not invoked when the component had missing elements. Tear down should always occur if it was previously registered, regardless of component state. Our test environment doesn't cover memory profiling, so no tests were added.
1 parent 542333d commit b4d79a6

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

packages/calcite-components/src/utils/floating-ui.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -581,12 +581,6 @@ export async function connectFloatingUI(component: FloatingUIComponent): Promise
581581
* @param component - A floating-ui component.
582582
*/
583583
export function disconnectFloatingUI(component: FloatingUIComponent): void {
584-
const { floatingEl, referenceEl } = component;
585-
586-
if (!floatingEl || !referenceEl) {
587-
return;
588-
}
589-
590584
const trackedState = autoUpdatingComponentMap.get(component);
591585

592586
if (trackedState?.state === "active") {

0 commit comments

Comments
 (0)