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

Make Quill instances detachable and reconfigurable #4402

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

singintime
Copy link

Motivation

This PR addresses discussion #4397 and issue #4234, providing a way to apply a new configuration to an existing Quill editor. Please refer to those for further information about the reasons behind this change.

Proposed changes

  • Adding a Subscriber class, acting as a proxy to the EventTarget API and keeping track of all subscriptions to event listeners originated by Quill components and modules,
  • Adding getters and setters to bind Subscriber instances to Quill root elements. Subscriber instances are stored in a WeakMap, similar to what happens for Quill instances.
  • Using the subscriber to replace all non-static calls of addEventListener(),
  • Unsubscribing from all event listeners originated by blots when they detach(),
  • Unsubscribing from all events originated by a Quill instance when detached or reconfigured,
  • Adding a detach() cleanup method to Quill instances,
  • Adding a configure() method to apply a new configuration to an already existing instance of Quill,
  • Providing unit test coverage for the above-mentioned changes.

@singintime singintime closed this Sep 13, 2024
@singintime singintime reopened this Sep 13, 2024
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

Successfully merging this pull request may close these issues.

2 participants