You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove blank line under a 'none' content block will remove 'none' block together #605
Describe the bug
When I need to remove a blank line under a 'none' type content, it never works, remove the 'none' content together.
I think remove a blank line is reasonable action.
Is the solution here to check if the block is paragraph, has no content, and focus is start of block (should be impossible to meet these criteria and not meet this one). If that matches, then delete the block rather than merging it?
@matthewlipski I'm not sure any of the code blocks there handle that cases this. At least when I looked into it, I came to that conclusion.
I wrote some custom keydown handlers (on BlockNoteView) that handle this case and another. One big thing here is pulling the children from the block to the prevBlock:
Hmm have you tried modifying the code from BNMergeBlocks? I think if you just remove the .replacehere, you should get pretty close to the correct behaviour. The difference is that BNMergeBlocks will just un-nest the children of the later block, rather than attaching them to the previous one which might still be a dealbreaker. Either way I think it's smth you might want to look into
Activity
sb8244 commentedon Aug 12, 2024
Is the solution here to check if the block is paragraph, has no content, and focus is start of block (should be impossible to meet these criteria and not meet this one). If that matches, then delete the block rather than merging it?
matthewlipski commentedon Aug 27, 2024
Yeah that sounds right - we should already have quite some backspace handling logic here for that, but seems like this case isn't accounted for
sb8244 commentedon Aug 27, 2024
@matthewlipski I'm not sure any of the code blocks there handle that cases this. At least when I looked into it, I came to that conclusion.
I wrote some custom keydown handlers (on
BlockNoteView) that handle this case and another. One big thing here is pulling the children from the block to the prevBlock:matthewlipski commentedon Aug 28, 2024
Hmm have you tried modifying the code from
BNMergeBlocks? I think if you just remove the.replacehere, you should get pretty close to the correct behaviour. The difference is thatBNMergeBlockswill just un-nest the children of the later block, rather than attaching them to the previous one which might still be a dealbreaker. Either way I think it's smth you might want to look intolamtuanamc commentedon Nov 25, 2024
Hi @matthewlipski, I've created a pull request to resolve this issue. Could you please review it at your convenience? Thank you!