fix: ensures nested lists always render properly
This commit is contained in:
@@ -5,7 +5,9 @@ const isListActive = (editor: Editor, format: string): boolean => {
|
||||
// If focus or anchor is at root of editor,
|
||||
// Return false - as Editor.parent will fail
|
||||
|| editor.selection.focus.path[1] === 0
|
||||
// || editor.selection.focus.path.length === 0
|
||||
|| editor.selection.anchor.path[1] === 0
|
||||
// || editor.selection.anchor.path.length === 0
|
||||
) return false;
|
||||
|
||||
const parentLI = Editor.parent(editor, editor.selection);
|
||||
|
||||
@@ -3,7 +3,7 @@ import listTypes from '../listTypes';
|
||||
|
||||
const LI = (props) => {
|
||||
const { attributes, element, children } = props;
|
||||
const disableListStyle = element.children.length === 1 && listTypes.includes(element.children?.[0]?.type);
|
||||
const disableListStyle = element.children.length >= 1 && listTypes.includes(element.children?.[0]?.type);
|
||||
|
||||
return (
|
||||
<li
|
||||
|
||||
Reference in New Issue
Block a user