Skip to content

Commit fbe9d24

Browse files
committed
Have imageOutputBinding actually resize the image on resize
1 parent 9ec33e7 commit fbe9d24

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

inst/www/shared/shiny.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

inst/www/shared/shiny.min.js.map

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

srcts/src/bindings/output/image.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,12 @@ class ImageOutputBinding extends OutputBinding {
290290
width: number | string,
291291
height: number | string
292292
): void {
293-
$(el).find("img").trigger("resize");
294-
return;
295-
width;
296-
height;
293+
const img = $(el).find("img");
294+
295+
img.attr("width", width);
296+
img.attr("height", height);
297+
298+
img.trigger("resize");
297299
}
298300
}
299301

0 commit comments

Comments
 (0)