Skip to content

Commit

Permalink
fix(dialog, modal, popover, sheet): fixes an issue that caused extra …
Browse files Browse the repository at this point in the history
…containers to be lost after internal trap updates (#11556)

**Related Issue:** #11523 

## Summary

#11548 missed calling
the internal update focus trap method, using the public method instead,
which clears user-specified `extraContainers`.
  • Loading branch information
jcfranco authored Feb 14, 2025
1 parent 08e7b31 commit 455cb5a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ export class Dialog extends LitElement implements OpenCloseComponent {
}

private handleMutationObserver(): void {
this.updateFocusTrapElements();
this.focusTrap.updateContainerElements();
}

// #endregion
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class Modal extends LitElement implements OpenCloseComponent {
private modalContent = createRef<HTMLDivElement>();

private mutationObserver: MutationObserver = createObserver("mutation", () =>
this.updateFocusTrapElements(),
this.focusTrap.updateContainerElements(),
);

private _open = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Popover extends LitElement implements FloatingUIComponent, OpenClos
private hasLoaded = false;

private mutationObserver: MutationObserver = createObserver("mutation", () =>
this.updateFocusTrapElements(),
this.focusTrap.updateContainerElements(),
);

transitionProp = "opacity" as const;
Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/components/sheet/sheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ export class Sheet extends LitElement implements OpenCloseComponent {
}

private handleMutationObserver(): void {
this.updateFocusTrapElements();
this.focusTrap.updateContainerElements();
}

// #endregion
Expand Down

0 comments on commit 455cb5a

Please sign in to comment.