From f3032b0635c4ec204c06e9705a9453e45071863d Mon Sep 17 00:00:00 2001 From: Sebastian Balcerowiak Date: Fri, 17 Jan 2025 03:09:39 +0100 Subject: [PATCH] [image-view] fix resizeObserver v2 --- packages/image-view/lib/image-editor-view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/image-view/lib/image-editor-view.js b/packages/image-view/lib/image-editor-view.js index 7afbb50e6a..adfe429c06 100644 --- a/packages/image-view/lib/image-editor-view.js +++ b/packages/image-view/lib/image-editor-view.js @@ -111,7 +111,7 @@ class ImageEditorView { this.resizeObserver = new ResizeObserver(() => { if (this.auto) { - this.zoomToFit(1) + this.zoomToFit(typeof this.auto === "number" ? this.auto : false) } }) this.resizeObserver.observe(this.refs.imageContainer) @@ -240,7 +240,7 @@ class ImageEditorView { ) if (limit) { zoom = Math.min(zoom, limit) } this.updateSize(zoom) - this.auto = true + this.auto = limit ? limit : true this.refs.zoomToFitButton.classList.add('selected') }