Trigger event when Text Editor is attached

Created on 6 November 2022, almost 3 years ago
Updated 15 June 2023, about 2 years ago

Problem/Motivation

It would be helpful if a javascript event was triggered when a CKEditor5 instance is created. Currently, it is possible for other modules to interact with editor instances using the Drupal.CKEditor5Instances map, but because the editor is created asynchronously, there's not a good way to know when the instance is ready to interact with. By triggering an even during the promise resolution, it would be possible for other code to react to it once it's ready.

My specific use case is that I have a form where some fields are disabled to start until the user clicks a checkbox toggle to enable them. I can do that using ckeditor's enableReadOnlyMode and disableReadOnlyMode methods, but I'm not able to have it initially set to read only on page load.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Needs review

Version

10.0 ✨

Component
EditorΒ  β†’

Last updated 17 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States jeffm2001

Live updates comments and jobs are added and updated live.
  • API addition

    Enhances an existing API or introduces a new subsystem. Depending on the size and impact, possibly backportable to earlier major versions.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024