frappe / frappe/draw

Clicking a mind-map/flowchart node's '+' preview does nothing on the first click when the node isn't already selected

Open
#576 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
21
Forks
13
Avg merge
2d 18h
Merged PRs (30d)
24

Description

## Reported via manual QA

Clicking the previewed "+" insertion handle on a mind-map or flowchart node that is not currently selected does nothing on the first click. Clicking again (a second click) then adds the node. Every click on a "+" should add the node immediately, regardless of prior selection state.

## Repro

1. Have a mind-map or flowchart with at least one node that is not currently selected.
2. Hover the node so its "+" insertion handle(s) appear.
3. Click a "+" handle once — nothing happens.
4. Click the same "+" handle again — the new node is now added.

## Investigation so far (unconfirmed root cause — needs live tracing)

`frontend/src/components/canvas/MindmapHoverHandles.vue`'s "+" button (`@click.stop="add(handle)"`, ~lines 235-236) has no explicit gate on prior selection state that could be found by static reading, and the `handles`/`ctx` computeds (~lines 57-59) are derived structurally rather than keyed off which node is currently selected. So the handler itself doesn't obviously no-op on a first click.

The likely mechanism (needs confirming by reproducing with devtools / a debugger, not just reading): a plain click on an unselected node first runs the shared node-selection path (mousedown selects it), and the "+" handles' position may be recomputed / re-laid-out reactively in response to that selection change *between* pointerdown and the click event actually firing — shifting the button out from under the cursor before the click registers, so the first click effectively misses. The second click then lands correctly because the node is already selected and the handle position is stable.

## Expected behavior

A click on a "+" handle should add the node on the first click, whether or not the parent node was already selected — no double-click-required behavior.

## Where to look

- `frontend/src/components/canvas/MindmapHoverHandles.vue` — the "+" button's click handler and the `handles`/`ctx` computeds that position it
- `frontend/src/components/canvas/FlowchartHoverHandles.vue` — likely has the same pattern for flowchart nodes; check whether it has the same bug
- Whatever selects a node on mousedown (search for the shared selection path node components route through) — to confirm/rule out the reactive-reposition-mid-click theory above

## Related
Several other "+" handle issues exist (closed): #516, #515, #511, #264 — different specific symptoms of the same "+" handle interaction area, worth checking whether any fix there touched this click-registration path.

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with an unselected node, then inspect frontend/src/components/canvas/MindmapHoverHandles.vue and FlowchartHoverHandles.vue, focusing on the "+" click handlers, handle positioning, and shared node-selection path. Use devtools or a debugger to trace pointerdown through click and confirm whether selection repositions the handle. Done means one click on either handle adds the node regardless of prior selection.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.