fix: Do not activate pan & zoom on a detached element (#2640)

- Closes: #2633
This commit is contained in:
Dermot Duffy
2026-07-30 21:33:37 -07:00
committed by GitHub
parent f24064689a
commit 51c0fab1ce
2 changed files with 68 additions and 24 deletions
@@ -111,6 +111,12 @@ export class ZoomController {
}
public activate(): void {
// Panzoom throws if it is constructed against an element that is not
// attached to the DOM.
if (!this._element.isConnected) {
return;
}
const config = this._getConfigToUse();
const converted = this._convertPercentToXYPan(
config?.pan?.x ?? ZOOM_DEFAULT_PAN_X,