From 101449dd37687525a92edcddbbb817da95595a69 Mon Sep 17 00:00:00 2001 From: zhangchi Date: Sat, 23 Jul 2022 23:20:52 +0800 Subject: [PATCH] fix(selection): iframe slow selection --- .../src/components/source-view/SourceView.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libs/components/editor-blocks/src/components/source-view/SourceView.tsx b/libs/components/editor-blocks/src/components/source-view/SourceView.tsx index c044c117a0..47d06564f6 100644 --- a/libs/components/editor-blocks/src/components/source-view/SourceView.tsx +++ b/libs/components/editor-blocks/src/components/source-view/SourceView.tsx @@ -8,7 +8,15 @@ import { formatUrl } from './format-url'; import { SCENE_CONFIG } from '../../blocks/group/config'; import { services } from '@toeverything/datasource/db-service'; import { debounce } from '@toeverything/utils'; - +const MouseMaskContainer = styled('div')({ + position: 'absolute', + zIndex: 1, + top: '0px', + left: '0px', + right: '0px', + bottom: '0px', + backgroundColor: 'transparent', +}); export interface Props { block: AsyncBlock; editorElement?: () => JSX.Element; @@ -149,6 +157,7 @@ export const SourceView: FC = props => { const { link, isSelected, block, editorElement } = props; const { scene } = useRecastBlockScene(); const src = formatUrl(link); + if (src?.startsWith('http')) { return (
= props => { src={src} frameBorder="0" allowFullScreen + sandbox="allow-scripts allow-popups allow-top-navigation-by-user-activation allow-forms allow-same-origin" /> +
);