Skip to content

Commit

Permalink
[image-view] fix resizeObserver v2
Browse files Browse the repository at this point in the history
  • Loading branch information
asiloisad committed Jan 17, 2025
1 parent 7433f61 commit f3032b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/image-view/lib/image-editor-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
}

Expand Down

0 comments on commit f3032b0

Please sign in to comment.