Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts
Outdated
Show resolved
Hide resolved
nperez0111
left a comment
There was a problem hiding this comment.
Will hold on this until we get that PR through
packages/core/src/api/blockManipulation/commands/mergeBlocks/mergeBlocks.ts
Outdated
Show resolved
Hide resolved
| if ( | ||
| !prevBlockInfo || | ||
| !prevBlockInfo.isBlockContainer || | ||
| prevBlockInfo.blockContent.node.type.spec.content !== "inline*" | ||
| ) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
can we add a todo on why we early return here
There was a problem hiding this comment.
Not really a TODO, we return early intentionally as we can't merge blocks unless they both have inline content. Otherwise, we delete the previous block, which is handled in a different command.
There was a problem hiding this comment.
Also if the previous block is a column list, that also gets handled separately
There was a problem hiding this comment.
Sorry not a todo, a comment
| tr.setSelection( | ||
| TextSelection.near(tr.doc.resolve($columnPos.pos - 1)), | ||
| TextSelection.near(tr.doc.resolve($columnPos.pos)), |
There was a problem hiding this comment.
text selection is after now? Intentional?
There was a problem hiding this comment.
Wdym? Like it's after fixColumnList or the selection itself is different?
There was a problem hiding this comment.
This changes the position of where the selection is restored to (at least from the previous behavior) is it intentional?
nperez0111
left a comment
There was a problem hiding this comment.
How do you test the delete key on macOS? I'm unsure how to do it
packages/core/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts
Outdated
Show resolved
Hide resolved
I think it's Fn+Backspace but not 100% sure since I use a keyboard with Windows modifiers |
# Conflicts: # tests/src/utils/const.ts
Summary
This PR adds full Delete key handling, building on the existing logic. The additional cases are mainly for nested blocks and multi-column blocks.
R.e. multi-column, Backspace key handling has also been slightly changed to be more consistent. Specifically, whenever a block moves into a column after pressing Backspace or Delete, it now always gets added as a new block. Previously, it would sometimes be merged with the current block.
Rationale
While Delete isn't used as much as Backspace, proper handling for it is still needed.
Changes
columnList.getNextBlockInfohelper.getParentBlockInfohelper.Impact
N/A
Testing
Added e2e tests for Delete key handling:
Screenshots/Video
N/A
Checklist
Additional Notes