Skip to content

fix: keep newly created text block editable through the creating click - #697

Open
stravo1 wants to merge 2 commits into
frappe:developfrom
stravo1:fix-text-selection-on-create
Open

fix: keep newly created text block editable through the creating click#697
stravo1 wants to merge 2 commits into
frappe:developfrom
stravo1:fix-text-selection-on-create

Conversation

@stravo1

@stravo1 stravo1 commented Jul 28, 2026

Copy link
Copy Markdown
Member

Selecting synchronously in makeBlockEditable prevents the block's own deferred selectBlock call from clearing editableBlock right after it's set. TextBlock also swallows the one spurious click-outside event that the creating click's native "click" triggers before the block has rendered, and catches up the focus/edit-mode entry that the isEditable watch missed because the editor didn't exist yet at mount time.

Before:

Screen.Recording.2026-07-28.at.12.20.50.PM.mov

After:

Screen.Recording.2026-07-28.at.12.21.28.PM.mov

Selecting synchronously in makeBlockEditable prevents the block's own
deferred selectBlock call from clearing editableBlock right after it's
set. TextBlock also swallows the one spurious click-outside event that
the creating click's native "click" triggers before the block has
rendered, and catches up the focus/edit-mode entry that the isEditable
watch missed because the editor didn't exist yet at mount time.
Comment thread frontend/src/block.ts Outdated
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (2): Last reviewed commit: "fix: Respect select=false for text child..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.59%. Comparing base (f16bae0) to head (4e835d8).
⚠️ Report is 16 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #697      +/-   ##
===========================================
+ Coverage    56.88%   57.59%   +0.70%     
===========================================
  Files           35       35              
  Lines         4217     4271      +54     
===========================================
+ Hits          2399     2460      +61     
+ Misses        1818     1811       -7     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stravo1 stravo1 changed the title fix: Keep newly created text block editable through the creating click fix: keep newly created text block editable through the creating click Jul 28, 2026
@stravo1
stravo1 requested a review from surajshetty3416 July 28, 2026 07:09
addChild called makeBlockEditable() for text children even when a
caller passed select=false, so component-instance sync and
drag-to-a-new-parent reordering could select and focus a text block
with no user interaction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant