Skip to content

Commit f52d781

Browse files
committed
fix(blog): mindmap
1 parent dd48e45 commit f52d781

File tree

1 file changed

+4
-1
lines changed
  • src/components/CodeViewer/blog-flows/mindmap/App

1 file changed

+4
-1
lines changed

src/components/CodeViewer/blog-flows/mindmap/App/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ function Flow() {
8686
(event) => {
8787
const { nodeInternals } = store.getState();
8888
const targetIsPane = (event.target as Element).classList.contains('react-flow__pane');
89+
const node = (event.target as Element).closest('.react-flow__node');
8990

90-
if (targetIsPane && connectingNodeId.current) {
91+
if (node) {
92+
node.querySelector('input')?.focus({ preventScroll: true });
93+
} else if (targetIsPane && connectingNodeId.current) {
9194
const parentNode = nodeInternals.get(connectingNodeId.current);
9295
const childNodePosition = getChildNodePosition(event, parentNode);
9396

0 commit comments

Comments
 (0)