From 05361e75a405745e4a3f5c5328e9917ee47c6345 Mon Sep 17 00:00:00 2001 From: lawvs <18554747+lawvs@users.noreply.github.com> Date: Wed, 17 Aug 2022 19:08:16 +0800 Subject: [PATCH] fix: add pen background --- .../src/blocks/group/scene-kanban/CardItem.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx b/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx index c1cc9f9a1c..c98efdf0f5 100644 --- a/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx +++ b/libs/components/editor-blocks/src/blocks/group/scene-kanban/CardItem.tsx @@ -1,5 +1,9 @@ -import type { KanbanCard } from '@toeverything/components/editor-core'; -import { RenderBlock, useKanban } from '@toeverything/components/editor-core'; +import { + KanbanCard, + RenderBlock, + useEditor, + useKanban, +} from '@toeverything/components/editor-core'; import { PenIcon } from '@toeverything/components/icons'; import { IconButton, @@ -89,6 +93,7 @@ export const CardItem = ({ const { openSubPage } = useRefPage(); const [editable, setEditable] = useState(false); const showKanbanRefPageFlag = useFlag('ShowKanbanRefPage', false); + const { editor } = useEditor(); const onAddItem = async () => { setEditable(true); @@ -108,9 +113,13 @@ export const CardItem = ({ {!editable && ( { e.stopPropagation(); setEditable(true); + editor.selectionManager.activeNodeByNodeId( + block.id + ); }} >