fix: NaN invalid CSS width issue

This commit is contained in:
Tom Moor
2023-04-18 19:49:56 -04:00
parent d04b15a04b
commit e4fb151a71
2 changed files with 8 additions and 4 deletions

View File

@@ -574,8 +574,8 @@ class ControlledBase extends Component<
tmp.innerHTML = imgEl.outerHTML;
const svg = tmp.firstChild as SVGSVGElement;
svg.style.width = `${styleModalImg.width ?? 0}px`;
svg.style.height = `${styleModalImg.height ?? 0}px`;
svg.style.width = `${styleModalImg.width || 0}px`;
svg.style.height = `${styleModalImg.height || 0}px`;
svg.addEventListener("click", this.handleUnzoom);
refModalImg.current?.firstChild?.remove?.();