Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I increase depth of ordered lists #362

Closed
justinasci opened this issue Dec 14, 2022 · 3 comments
Closed

How do I increase depth of ordered lists #362

justinasci opened this issue Dec 14, 2022 · 3 comments
Assignees

Comments

@justinasci
Copy link

It seems that wrapping default to unordered lists. Shouldn't it be for both UL and OL?

wrapInList(editor, ListType.UNORDERED);

@justinasci
Copy link
Author

bump

@e1himself
Copy link
Contributor

Hi @justinasci

Apologies for the delayed response.

Actually, it's preserving the original list type increaseDepth() is called for.
If it's a UL, the new deeper list will be UL. It's an OL, the deeper list will be OL too.

See

it('Creates a child list in preceding sibling list item and moves list-item there, maintaining list type', () => {
const editor = (
<Editor normalizeNode={noop}>
<OrderedList>
<ListItem>
<ListItemText>
<Text>lorem ipsum</Text>
</ListItemText>
</ListItem>
<ListItem>
<ListItemText>
<Text>
dolor sit amet
<Cursor />
</Text>
</ListItemText>
</ListItem>
</OrderedList>
</Editor>
) as unknown as ListsEditor;
const expected = (
<Editor normalizeNode={noop}>
<OrderedList>
<ListItem>
<ListItemText>
<Text>lorem ipsum</Text>
</ListItemText>
<OrderedList>
<ListItem>
<ListItemText>
<Text>
dolor sit amet
<Cursor />
</Text>
</ListItemText>
</ListItem>
</OrderedList>
</ListItem>
</OrderedList>
</Editor>
) as unknown as ListsEditor;
increaseDepth(editor);
expect(editor.children).toEqual(expected.children);
expect(editor.selection).toEqual(expected.selection);
});

How would you expect it to work?

@e1himself e1himself self-assigned this Jan 18, 2023
@e1himself
Copy link
Contributor

This seems to be the same issue as #365 and #391. Please check those discussions.

If the issue remains, feel free to comment here to reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants