I’m making a custom paragraph block, but I’m having trouble allowing it to be merged with another of the same block type.
I’ve successfully implemented the onSplit function (paired with onReplace) by looking at the Gutenberg’s core/paragraph code so that hitting enter starts a new block, however, I’ve been unsuccessful attempting to do the same with onMerge.
The core/paragraph block has this functionality:
All I can find in the core/paragraph code is onMerge={mergeBlocks}
and I can’t find any documentation which demonstrates more detailed usage.
When I implement this line, my blocks do react to the backspace key (by moving the cursor to the start of the previous block), but don’t merge the blocks. This cursor shift only happens if I include the onMerge line.
My code is below, if anyone has any thoughts or examples on what I’m missing, I’d be delighted!
The Edit class is applied with this code:
- Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
- Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
- Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.
Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com