Closed O4epegb closed 1 year ago
I found what causes it but I'm not really sure how to better fix it.
So it happens because of reset node plugin, it overrides editor.deleteBackward
method and adds some logic there:
In case of a list this code just unsets list block to paragraph block while leaving list element in place. And because it uses withoutNormalizing
normalization does not happen if the plugin comes after list plugin in your plugin list. So one of the fixes is just use reset node plugin before list plugin, but for me it seems wrong that the order matters. Or not?
Other solution would be to add some special logic there to handle lists maybe?
I think we can generalize that delete backward at the start of the document should reset any block type into a paragraph, so we need a code that unwraps all blocks above and reset the props. With a query(entry)
option to be able to prevent that for strict format like Title.
P-178 is most likely the same bug and fixed with this ticket
Tracked in https://github.com/udecode/plate/issues/2025
Description
List element is not deletable if it's a first element in the editor
Steps
Reproducible in this example https://platejs.org
1) Delete everything 2) Create list element with autoformat rule
*
3) Press backspace to delete it 4) List is deleted, but list elements is still thereSandbox
https://platejs.org
Expectation
List element is deleted
Environment
P-176
Funding