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

[Bug]: can command not working correctly with list #4057

Open
2 tasks done
ashu12chi opened this issue May 18, 2023 · 2 comments
Open
2 tasks done

[Bug]: can command not working correctly with list #4057

ashu12chi opened this issue May 18, 2023 · 2 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug

Comments

@ashu12chi
Copy link

Which packages did you experience the bug in?

extension-ordered-list, extension-unordered-list, extension-task-list, core

What Tiptap version are you using?

2.0.3

What’s the bug you are facing?

We have can command in tiptap to check if a command can be executed - without actually executing it. I am using this command in my editor to check weather toggleOrderedList, toggleBulletList, and toggleTaskList can be executed or not.

These commands are returning false for the first item of an already present list, although we are able to execute these commands.

For example, if I have a bullet list, and I am at the first item of the list, then can command is returning I can't run toggleOrderedList, but actually we can run the command to change this list to an ordered list.

In below image, ordered-list is present and bullet-list button is disabled when we are at first item:
image

In below image, ordered-list is present and bullet-list button is not disabled when we are at second item:
image

We can execute the command in the both the cases can be verified here: https://tiptap.dev/examples/default

What browser are you using?

Chrome

Code example

https://codesandbox.io/s/sleepy-heyrovsky-fwddzb?file=/src/App.js

What did you expect to happen?

can command should work correctly.

Anything to add? (optional)

No response

Did you update your dependencies?

  • Yes, I’ve updated my dependencies to use the latest version of all packages.

Are you sponsoring us?

  • Yes, I’m a sponsor. 💖
@ashu12chi ashu12chi added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug labels May 18, 2023
@mejo-
Copy link
Contributor

mejo- commented Jun 7, 2023

Seems like quite a few commands get reported as not supported even though they can be used. E.g. editor.can().toggleBlockquote() inside a bullet list returns false, while editor.can().toggleCodeBlock() returns true.

@Nantris
Copy link
Contributor

Nantris commented Jun 7, 2023

Same issue. It seems to be related to #3743 as has already been mentioned by @mejo-

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Triage: Open A new issue or pullrequest that requires triage (added by default) Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Triage open
Development

No branches or pull requests

5 participants