Skip to content

fix: Backspace in empty block deletes previous block - #1505

Merged
matthewlipski merged 2 commits into
TypeCellOS:mainfrom
Martinrsts:backspace-handler
Mar 19, 2025
Merged

matthewlipski merged 2 commits into
TypeCellOS:mainfrom
Martinrsts:backspace-handler

Conversation

@Martinrsts

@Martinrsts Martinrsts commented Mar 6, 2025 •

Copy link
Copy Markdown
Contributor

This suggestion is for resolving some weird behaviour with the backspace like: Fixes #605 Fixes #1478 .
Also, when a block is empty and backspace is clicked, it makes more sense to remove the block as seen in here:

Old behaviour:
https://github.com/user-attachments/assets/85669900-267a-4f1f-8642-57585d2a77dd

New behaviour:
https://github.com/user-attachments/assets/9f7a8eff-83e0-4e06-af58-cdc275c162d6

@vercel

vercel Bot commented Mar 6, 2025

Copy link
Copy Markdown

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

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Mar 6, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
blocknote ✅ Ready (Inspect) Visit Preview Mar 19, 2025 6:50pm
blocknote-website ✅ Ready (Inspect) Visit Preview Mar 19, 2025 6:50pm

@matthewlipski

Copy link
Copy Markdown
Collaborator

Thanks for this! The change is nice, though I ended up re-writing it to make it clearer what's happening and sort out some edge cases.

@matthewlipski matthewlipski changed the title fix: removes current block instead of prev block if current block is … fix: Backspace in empty block deletes previous block Mar 19, 2025
@matthewlipski
matthewlipski merged commit 9cd16c0 into TypeCellOS:main Mar 19, 2025

This branch was successfully deployed

2 active deployments
Preview – blocknote-website — 48cbdd39 Deployed Mar 19, 2025 by vercel[bot]
Preview – blocknote — 48cbdd39 Deployed Mar 19, 2025 by vercel[bot]
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.

Improve delete key behavior near image blocks Remove blank line under a 'none' content block will remove 'none' block together

2 participants