Skip to content

fix(core): bind Mod-a to select all the document - #2975

Draft
Asodariyasujal wants to merge 1 commit into
TypeCellOS:mainfrom
Asodariyasujal:main-fix-command+A-work-sujal
Draft

fix(core): bind Mod-a to select all the document#2975
Asodariyasujal wants to merge 1 commit into
TypeCellOS:mainfrom
Asodariyasujal:main-fix-command+A-work-sujal

Conversation

@Asodariyasujal

@Asodariyasujal Asodariyasujal commented Aug 16, 2026

Copy link
Copy Markdown

BlockNote had no Mod-a binding, so select-all was left to the browser's native contenteditable handling and ProseMirror had to rebuild a document selection from the DOM selection it produced.

That fails when a block puts non-editable content first, which check list items do: the checkbox div sits ahead of the <p> holding the block's content. So in a document starting with a check list item, ProseMirror could not map the DOM selection to a valid position and dropped it, leaving the caret in place - Backspace then only edited that one block instead of clearing the document.

Now Mod-a sets an AllSelection itself, which selects every block type reliably and deletes down to a single empty paragraph.

Also stops getNearestBlockPos warning for the positions at the very start and end of the doc, which is where an AllSelection ends.

Summary

Rationale

Changes

Impact

Testing

Screenshots/Video

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Additional Notes

BlockNote had no `Mod-a` binding, so select-all was left to the browser's
native `contenteditable` handling and ProseMirror had to rebuild a document
selection from the DOM selection it produced.

That fails when a block puts non-editable content first, which check list
items do: the checkbox div sits ahead of the `<p>` holding the block's
content. So in a document starting with a check list item, ProseMirror
could not map the DOM selection to a valid position and dropped it, leaving
the caret in place - Backspace then only edited that one block instead of
clearing the document.

Now `Mod-a` sets an `AllSelection` itself, which selects every block type
reliably and deletes down to a single empty paragraph.

Also stops `getNearestBlockPos` warning for the positions at the very start
and end of the doc, which is where an `AllSelection` ends.
@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

@Asodariyasujal is attempting to deploy a commit to the TypeCell Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 682027cd-9b0e-4986-8d11-6bbbb8bb8354

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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