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
When using the exitBreakPlugin, I've encountered an issue with the handling of the Enter key in list items. The plugin works as expected when the allow option is specified, but if allow is omitted, it deletes the text within list items.
Current Behavior
With allow specified for headings:
Pressing Enter after a list item creates a new list item (desired behavior).
Without allow specified:
Pressing Enter in a list item deletes the text in the current list item instead of creating a new list item (but not the list item node itself)
The rest of the exitBreakPlugin works fine with heading and other cases where you want to hard exit out of by default with enter.
It's possible that using exclude for ELEMENT_LI would workaround this issue, but it should not delete the items to begin with.
Reproduction URL
No response
Reproduction steps
Set up a Plate.js editor with the exitBreakPlugin.
Configure the plugin as follows:
import { createExitBreakPlugin } from '@udecode/plate-break';
import { ELEMENT_H1, ELEMENT_H2, ELEMENT_H3 } from '@udecode/plate';export const exitBreakPlugin = createExitBreakPlugin({
options: {
rules: [
{
hotkey: 'enter',
query: {
start: true,
end: true,
allow: [ELEMENT_H1, ELEMENT_H2, ELEMENT_H3], // Comment out this line to reproduce the issue
},
relative: true,
level: 0,
},
],
},
});
Create a list item.
Test pressing Enter within list items.
Comment out the allow line and repeat the test.
### Plate version
33.0.0
### Slate React version
0.104.0
### Browsers
Chrome
The text was updated successfully, but these errors were encountered:
Description
When using the
exitBreakPlugin
, I've encountered an issue with the handling of the Enter key in list items. The plugin works as expected when theallow
option is specified, but ifallow
is omitted, it deletes the text within list items.Current Behavior
With allow specified for headings:
Pressing Enter after a list item creates a new list item (desired behavior).
Without allow specified:
Pressing Enter in a list item deletes the text in the current list item instead of creating a new list item (but not the list item node itself)
The rest of the exitBreakPlugin works fine with heading and other cases where you want to hard exit out of by default with enter.
It's possible that using
exclude
for ELEMENT_LI would workaround this issue, but it should not delete the items to begin with.Reproduction URL
No response
Reproduction steps
The text was updated successfully, but these errors were encountered: