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]: still missing type editor.chain().focus().toggleBold() #5111

Closed
1 of 2 tasks
CooperHash opened this issue May 2, 2024 · 4 comments
Closed
1 of 2 tasks

[Bug]: still missing type editor.chain().focus().toggleBold() #5111

CooperHash opened this issue May 2, 2024 · 4 comments
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@CooperHash
Copy link

Which packages did you experience the bug in?

react

What Tiptap version are you using?

2.3.1

What’s the bug you are facing?

<button
        onClick={() => editor.chain().focus().toggleBold().run()}
        disabled={
          !editor.can()
            .chain()
            .focus()
            .toggleBold()
            .run()
        }
        className={editor.isActive('bold') ? 'is-active' : ''}
      >
Property 'toggleBold' does not exist on type 'ChainedCommands'. Did you mean 'toggleNode'?ts(2551)

What browser are you using?

Chrome

Code example

No response

What did you expect to happen?

it should not happend, it should have this type

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. 💖
@CooperHash CooperHash added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels May 2, 2024
@JacobGuiang
Copy link

I am getting this error with toggleUnderline() instead of toggleBold()

@CooperHash
Copy link
Author

ok thanks

@JacobGuiang
Copy link

I am getting this error with toggleUnderline() instead of toggleBold()

I was getting the error with toggleUnderline because I didn't realize the Underline extension was not included in StarterKit.
I had to add Underline to my extensions.

@nperez0111
Copy link
Contributor

The types only apply when you have that extension installed. The type definitely is there: https://github.com/ueberdosis/tiptap/blob/main/packages/extension-bold/src/bold.ts#L27

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. Type: Bug The issue or pullrequest is related to a bug
Projects
Status: Done
Development

No branches or pull requests

3 participants