Skip to content

Commit 2b25df1

Browse files
committed
fix #6645 -- jupyter image width bug
1 parent 17b9ee1 commit 2b25df1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/packages/frontend/jupyter/_jupyter.sass

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
.cocalc-jupyter-rendered
1010
img
1111
max-width: 100%
12-
height: auto
1312
table
1413
border: none
1514
border-collapse: collapse

src/packages/frontend/jupyter/output-messages/image.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export const Image: React.FC<ImageProps> = React.memo((props: ImageProps) => {
4141
function render_image(src, on_error?): JSX.Element {
4242
const props = {
4343
src,
44-
width: width,
45-
height: height,
44+
width,
45+
height,
4646
};
4747
props["style"] = {
4848
maxWidth: "100%",
49-
height: "auto",
49+
height: props.height ?? "auto",
5050
} as React.CSSProperties;
5151
if (on_error != null) {
5252
props["onError"] = on_error;

0 commit comments

Comments
 (0)