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

Add option to allow task items to be checkable (uncontrolled) #2474

Merged
merged 8 commits into from
May 20, 2022

Conversation

kaspnilsson
Copy link
Contributor

Useful for drafting interactive documents. Could see this expanding to potentially also support passing a callback?

Will happily update documentation if this approach is accepted!

Useful for drafting interactive documents. Could see this expanding to potentially also support passing a callback?

Will happily update documentation if this approach is accepted!
@netlify
Copy link

netlify bot commented Feb 2, 2022

👷 Deploy request for tiptap-embed pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 565f29a

@philippkuehn
Copy link
Contributor

Hey, thanks!

I’m happy to accept a checkable callback method to implement custom behavior here. But this should also control if the command is executed to update the checked attribute so this could be a fix for #2144 too.

An update for the docs would be great too ✌️

@bkempe
Copy link

bkempe commented Feb 3, 2022

I think this could be achieved via:

        if (!editor.isEditable && onReadOnlyChecked) {
          onReadOnlyChecked(node, checked);
        }

after

if (editor.isEditable && typeof getPos === 'function') { ... }

@kaspnilsson
Copy link
Contributor Author

Think I did what y'all requested, let me know if this works @philippkuehn @bkempe!

@kaspnilsson
Copy link
Contributor Author

Ping @philippkuehn @bkempe

@bkempe
Copy link

bkempe commented Feb 22, 2022

@kaspnilsson It's not up to me to approve, but it looks great :)

@bkempe
Copy link

bkempe commented Feb 22, 2022

@kaspnilsson One thing that might be nice: revert the change if onReadOnlyChecked returns false?

@bdbch
Copy link
Member

bdbch commented May 13, 2022

Hey @kaspnilsson - looks nice! I think we have some linting issues. Could you resolve them? I'll make sure to take a look again when you're done so we can get your work merged! 👍

@kaspnilsson
Copy link
Contributor Author

@bdbch done!

Copy link
Member

@bdbch bdbch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question about the dependencies. Otherwise looks good.

packages/extension-task-item/package.json Show resolved Hide resolved
@bdbch bdbch merged commit 6fe3024 into ueberdosis:main May 20, 2022
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

Successfully merging this pull request may close these issues.

4 participants