frappe / frappe/draw

Clicking empty canvas doesn't deselect an open table cell editor

Open Beginner friendly
#563 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

## What's broken

With a table cell editor open (`editingCell` set), clicking empty canvas — away from the table — does not commit/close the editor. The path is currently broken; only clicking another cell (`startCellRangeDrag`, which nulls `editingCell` on every press) reliably commits.

Flagged during #556/#557 review, and worked around rather than fixed in `ddc6fbe` (table-cell-text.spec.js's commit step was rewritten to click a neighbouring cell instead of relying on empty-canvas deselect, specifically because that path was "currently-broken").

## Where to look

- `frontend/src/composables/useWhiteboardInteraction.js` — `startCellRangeDrag` (clears `editingCell` on a cell press) vs. whatever handles a press on empty canvas outside any table.
- `frontend/src/composables/useTableCellEditor.js` — the editor's commit/close logic.

## Repro

1. Open a table cell for editing (double-click, or single-click per #556's click-to-select).
2. Click empty canvas away from the table.
3. Editor stays open instead of committing and closing.

## Suggested fix direction

Empty-canvas pointerdown should clear `editingCell` the same way `startCellRangeDrag` does for a cell press, committing whatever text is in progress first.

Contributor guide

Open the contributing guide

Research direction

Read frontend/src/composables/useWhiteboardInteraction.js around startCellRangeDrag and the empty-canvas press handling, then inspect frontend/src/composables/useTableCellEditor.js for commit/close behavior. Run the table-cell-text.spec.js test, which currently clicks a neighboring cell for its commit step. Done means clicking empty canvas commits the text and closes the editor, with the regression covered by the test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
86/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.