slab / quill

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

Quill2: Consistent Initialization Event for Modules #3374

Closed awderh closed 6 months ago

awderh commented 3 years ago

I'm requesting a consistent initialization event when the editor is created for a module I'm working on.

If Quill is init'd on a DOMElement that has existing innerHTML, then a editor-change or text-change event is fired. However, if there is no existing HTML, then an event is not fired.

I could create HTML within the DOM during module initialization (which occurs during theme.init(), but a local let html = ... variable within Quill creates ambiguity/inconsistency. So, I have the user trigger a module-specific .init() function after the editor has been initialized.

On Quill 1.X latest, this doesn't appear to be an issue.

Steps for Reproduction

  1. Visit https://jsfiddle.net/awderh/5asnev9p/23/
  2. Notice that the console does not output called on quill2

Expected behavior: Regardless of DOM content on init, trigger a text-change event or a similar event.

Actual behavior: Only text-change triggered when DOM content exists.

Platforms: Windows Firefox, Chrome, ... Version: 2.0 (Latest per NPM)

quill-bot commented 6 months ago

Quill 2.0 has been released (announcement post) with many changes and fixes. If this is still an issue please create a new issue after reviewing our updated Contributing guide :pray: