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

Modules are still active in disabled Quill 2.0 editor #4474

Open
berendengelbrecht opened this issue Oct 30, 2024 · 0 comments
Open

Modules are still active in disabled Quill 2.0 editor #4474

berendengelbrecht opened this issue Oct 30, 2024 · 0 comments

Comments

@berendengelbrecht
Copy link

berendengelbrecht commented Oct 30, 2024

We want to use quill 2.0 in a web page containing several editor instances. The web page will be initially read-only, but users having sufficient rights can edit and save the text. After saving, the web page should be read-only again.

The above works fine when we use only formatted text, but not when the text contains tables or images where custom modules are used for formatting.

  • For tables, we want to use https://cdn.jsdelivr.net/npm/[email protected]/, because it properly formats merged table cells received from the clipboard and has better table formatting options than the standard table module. Attached is a sample Word document containing tables not pasted correctly when standard table module is used:
    test-paste-table.docx
    image

  • For images, we want to use some kind of resize module. I tried several of them (a disadvantage of Quill is that it is quite unclear which version of a module is latest). This one seems to work well and has proper globalization, which we require: https://github.com/scrapooo/quill-resize-module

However, both of the above modules have a major disadvantage: when the quill 2.0 editor is "disabled", they are still operational. The text of the editor element appears to be read-only, but features handled by the modules can still be changed. See example screenshot below where both better-table-plus and resize-module are shown to be active in an editor instance that has the style ql-disabled and has the attribute contenteditable="false" set, both are done by calling .enable(false) on the editor instance.

I did not find any API to remove custom modules from an editor instance or to block module operation when the editor is supposedly disabled. Can you please enlighten me? As a workaround, I'll replace the editor by the rendered HTML output, but this is much more work than simply calling editor.enable(false). I do realize that custom modules are not maintained in this project, but my question is about generally disabling any module. If an issue report for quill 2.0 is not the correct channel for reporting this type of issue, please tell me where I should report this.

============================

disabled-quill-modules-active

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

1 participant