From c5462efcb4805bf0cb555c24c91d3923a27c548c Mon Sep 17 00:00:00 2001 From: fantasticit Date: Tue, 26 Apr 2022 19:14:01 +0800 Subject: [PATCH] tiptap: fix resize container size --- .../client/src/tiptap/wrappers/iframe/index.module.scss | 1 + packages/client/src/tiptap/wrappers/iframe/index.tsx | 6 +++--- packages/client/src/tiptap/wrappers/image/index.tsx | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/client/src/tiptap/wrappers/iframe/index.module.scss b/packages/client/src/tiptap/wrappers/iframe/index.module.scss index 0d03ae4..9f34544 100644 --- a/packages/client/src/tiptap/wrappers/iframe/index.module.scss +++ b/packages/client/src/tiptap/wrappers/iframe/index.module.scss @@ -17,6 +17,7 @@ .innerWrap { position: relative; width: 100%; + height: 100%; overflow: hidden; border-radius: var(--border-radius); flex: 1; diff --git a/packages/client/src/tiptap/wrappers/iframe/index.tsx b/packages/client/src/tiptap/wrappers/iframe/index.tsx index aedf845..eca46f7 100644 --- a/packages/client/src/tiptap/wrappers/iframe/index.tsx +++ b/packages/client/src/tiptap/wrappers/iframe/index.tsx @@ -29,7 +29,7 @@ export const IframeWrapper = ({ editor, node, updateAttributes }) => { )} ), - [url] + [url, width, height] ); if (!isEditable && !url) { @@ -39,8 +39,8 @@ export const IframeWrapper = ({ editor, node, updateAttributes }) => { return ( {isEditable ? ( - - {content} + +
{content}
) : (
{content}
diff --git a/packages/client/src/tiptap/wrappers/image/index.tsx b/packages/client/src/tiptap/wrappers/image/index.tsx index fb2ffcf..64b42c0 100644 --- a/packages/client/src/tiptap/wrappers/image/index.tsx +++ b/packages/client/src/tiptap/wrappers/image/index.tsx @@ -80,7 +80,7 @@ export const ImageWrapper = ({ editor, node, updateAttributes }) => { if (isEditable) { return ( - + {img} ); @@ -91,7 +91,7 @@ export const ImageWrapper = ({ editor, node, updateAttributes }) => { {img} ); - }, [error, src, isEditable]); + }, [error, src, isEditable, width, height]); return (