From ea7da9d6a368751ebe8de80c02b00ae43204c44d Mon Sep 17 00:00:00 2001 From: fantasticit Date: Tue, 22 Mar 2022 12:44:30 +0800 Subject: [PATCH] fix: show image bubble menu when there is a src --- packages/client/src/components/tiptap/menus/image.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/client/src/components/tiptap/menus/image.tsx b/packages/client/src/components/tiptap/menus/image.tsx index d4c27279..b72a21ae 100644 --- a/packages/client/src/components/tiptap/menus/image.tsx +++ b/packages/client/src/components/tiptap/menus/image.tsx @@ -26,7 +26,7 @@ export const ImageBubbleMenu = ({ editor }) => { className={'bubble-menu'} editor={editor} pluginKey="image-bubble-menu" - shouldShow={() => editor.isActive(Image.name) && !!attrs.src} + shouldShow={() => editor.isActive(Image.name) && !!editor.getAttributes(Image.name).src} tippyOptions={{ maxWidth: 456, }}