From a3a442a34f1ea465fe8e91813f5be10e67b767be Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 13 Apr 2024 17:47:44 +0800 Subject: [PATCH] fix: fix image message context menu cannot save image problem --- .../com.msgbyte.bbcode/src/tags/ImgTag.tsx | 21 ++++++++++++------- client/web/src/plugin/common/index.ts | 1 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/ImgTag.tsx b/client/web/plugins/com.msgbyte.bbcode/src/tags/ImgTag.tsx index f3826fb3..d7139812 100644 --- a/client/web/plugins/com.msgbyte.bbcode/src/tags/ImgTag.tsx +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/ImgTag.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import { getPopupContainer } from '@capital/common'; import { Image } from '@capital/component'; import type { TagProps } from '../bbcode/type'; @@ -44,14 +45,18 @@ export const ImgTag: React.FC = React.memo((props) => { const url = node.attrs.url ?? text; return ( - +
e.stopPropagation()}> + +
); }); ImgTag.displayName = 'ImgTag'; diff --git a/client/web/src/plugin/common/index.ts b/client/web/src/plugin/common/index.ts index 9e1292c7..02cb3b71 100644 --- a/client/web/src/plugin/common/index.ts +++ b/client/web/src/plugin/common/index.ts @@ -22,6 +22,7 @@ export { export { Loadable } from '@/components/Loadable'; export { useIsMobile } from '@/hooks/useIsMobile'; export { isMobile } from '@/utils/device-helper'; +export { getPopupContainer } from '@/utils/dom-helper'; export { getGlobalState, useGlobalSocketEvent,