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

Checked task is not presend in saved delta #7

Open
damikun opened this issue Nov 3, 2020 · 2 comments
Open

Checked task is not presend in saved delta #7

damikun opened this issue Nov 3, 2020 · 2 comments

Comments

@damikun
Copy link
Contributor

damikun commented Nov 3, 2020

If you use Delta as input

If I check any item as "done" this information is not present in Delta JSON file...

Problem:

  • After saving, delta information about checked item is not present in Delta JSON
  • The list will be always unchecked after quill delta save and reload delta (forexample from db

The main state of Quill should be stored as delta and than generate html from that but it seems from code that this task-list "check" is based on html checks... and did not update delta after check event is fire...

Reason of problem: (this is not delta friendly solution)

class TaskListModule extends Module {
  constructor(quill, options) {
    super(quill, options);

    this.quill.container.addEventListener('click', (e) => {
      if (e.target.matches('ul.task-list > li')) {
        e.target.classList.toggle('checked');
        // dummy update so that quill detects a change
        this.quill.updateContents(new Delta().retain(1));
      }
    });
  }
}

Edited:
Seems like package is not maintained anymore...

There is also build-in quill checklist

           modules={{
              toolbar: [
                { list: "ordered" },
                { list: "bullet" },
                { list: "check" },
              ],
            }}
@koffeinfrei
Copy link
Owner

Can you check if #1 solves that issue?

There is also build-in quill checklist

Where's that? AFAIK they still haven't gotten around implementing it in quill.

@damikun
Copy link
Contributor Author

damikun commented Nov 7, 2020

Maybe not closed, but you can use checkbox list directly from quill now... documentation is missing for that... i found it on GitHub and i running that already in my code.. working well.. But i did not know that on time writing this issue..

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