mirror of
https://github.com/outline/outline.git
synced 2026-11-30 09:00:18 +03:00
fix: NaN invalid CSS width issue
This commit is contained in:
1 parent
d04b15a04b
commit
e4fb151a71
2 files changed
+8
-4
No files matched your search
@@ -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?.();
|
||||
|
||||
@@ -75,8 +75,11 @@ export const getScale: GetScale = ({
|
||||
offset,
|
||||
targetHeight,
|
||||
targetWidth,
|
||||
}) =>
|
||||
!hasScalableSrc && targetHeight && targetWidth
|
||||
}) => {
|
||||
if (!containerHeight || !containerWidth) {
|
||||
return 1;
|
||||
}
|
||||
return !hasScalableSrc && targetHeight && targetWidth
|
||||
? getScaleToWindowMax({
|
||||
containerHeight,
|
||||
containerWidth,
|
||||
@@ -89,6 +92,7 @@ export const getScale: GetScale = ({
|
||||
offset,
|
||||
width: containerWidth,
|
||||
});
|
||||
};
|
||||
|
||||
const URL_REGEX = /url(?:\(['"]?)(.*?)(?:['"]?\))/;
|
||||
|
||||
|
||||
Reference in new issue
Block a user