slab / quill

Quill is a modern WYSIWYG editor built for compatibility and extensibility
https://quilljs.com
BSD 3-Clause "New" or "Revised" License
43.16k stars 3.35k forks source link

Event listeners of emitter are not removed when quill editor is destroyed #4360

Open JulienBier opened 1 month ago

JulienBier commented 1 month ago

Hello, When the quill editor is destroyed, the events are still listened to. Therefore, when I recreate an editor later, the mousedown, mouseup and selectionchange events are triggered. Would it be possible to unregister them or add an API method to do so?

https://github.com/slab/quill/blob/b213e1073bac1478649f26e3c0dad50ad0eb2a49/packages/quill/src/core/emitter.ts#L9

Platforms:

All browsers

Version:

'2.0.2'

elindgren commented 1 month ago

I'm experiencing something similar in my code. My problem is that the toolbar stops working after quill has been reinstantiated (needed since the modules change), as described in #4237