File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
plugins/com.msgbyte.bbcode/src/tags Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2+ import { getPopupContainer } from '@capital/common' ;
23import { Image } from '@capital/component' ;
34import type { TagProps } from '../bbcode/type' ;
45
@@ -44,14 +45,18 @@ export const ImgTag: React.FC<TagProps> = React.memo((props) => {
4445 const url = node . attrs . url ?? text ;
4546
4647 return (
47- < Image
48- style = { {
49- ...imageStyle ,
50- ...parseImageAttr ( node . attrs as any ) ,
51- } }
52- preview = { true }
53- src = { url }
54- />
48+ < div className = "inline-block" onContextMenu = { ( e ) => e . stopPropagation ( ) } >
49+ < Image
50+ style = { {
51+ ...imageStyle ,
52+ ...parseImageAttr ( node . attrs as any ) ,
53+ } }
54+ preview = { {
55+ getContainer : getPopupContainer ,
56+ } }
57+ src = { url }
58+ />
59+ </ div >
5560 ) ;
5661} ) ;
5762ImgTag . displayName = 'ImgTag' ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export {
2222export { Loadable } from '@/components/Loadable' ;
2323export { useIsMobile } from '@/hooks/useIsMobile' ;
2424export { isMobile } from '@/utils/device-helper' ;
25+ export { getPopupContainer } from '@/utils/dom-helper' ;
2526export {
2627 getGlobalState ,
2728 useGlobalSocketEvent ,
You can’t perform that action at this time.
0 commit comments