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
Lists are complex nested structures. In your case isActive('bulletList'), isActive('orderedList'), isActive('listItem') and isActive('paragraph') returns true. I could imagine that only the closest block node is checked in isActive, but this would be paragraph in this case, which you would also not expect.
You have to write your own method to handle these specific cases.
const{ extensionManager, state }=editor;const{ extensions }=extensionManager;const{ selection }=state;// see https://github.com/ueberdosis/tiptap/blob/10248f276320d39fb0fd0cc6786ae2de4d219ec7/packages/core/src/commands/toggleList.ts#L86constparentList=findParentNode(node=>isList(node.type.name,extensions))(selection,);returnparentList!==undefined&&parentList.node.type.name===nodeType;
What’s the bug you are facing?
When you have a nested list of ordered and unordered like

and you select the nested line you end up with both
editor.isActive('bulletList')
andeditor.isActive('orderedList')
astrue
How can we reproduce the bug on our side?
I made a sandbox
Can you provide a CodeSandbox?
https://codesandbox.io/s/amazing-paper-mefbe?file=/src/App.js
What did you expect to happen?
I expect that if I'm on a bulleted line then only isActive('bulletList') is true and it is not affected by the parent
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: