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

Mention forcing initial rerender #266

Open
RoryGudka opened this issue Nov 10, 2022 · 2 comments
Open

Mention forcing initial rerender #266

RoryGudka opened this issue Nov 10, 2022 · 2 comments

Comments

@RoryGudka
Copy link

RoryGudka commented Nov 10, 2022

Lines 413 to 415 of quill.mention.csj.js has the value method of the MentionBlot as follows:

function value(domNode) {
return domNode.dataset;
}

However, this returns a DOMStringMap, which is considered different from the object format storable in JSON, and it triggers a rerender of the editor. While harmless in simple editors, this can cause significant issues as the editor gains complexity. Switching it to the following fixed a number of problems for the project I'm working on:

function value(domNode) {
return { ...domNode.dataset };
}

@laikee99
Copy link

well work, I've do the same thing.

@MadSpindel
Copy link
Member

Could you submit a PR?

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

3 participants