CKEditor 5 doesn't honour #disabled: enable CKEditor 5's readonly mode

Created on 3 April 2023, over 1 year ago
Updated 3 October 2023, about 1 year ago

Problem/Motivation

When settings a filtered text are marked as disabled. The CKEditor acts as normal.

I have tested this on CKEditor 4 and it acts as expected and the editor is not editible.

Steps to reproduce

Since this is on Drupal 9.5.x we are able to run both CKEditor 4 and 5, so I have duplicated the full html filter to create the ckeditor5 filter. and then I can test both to show the issue.

CKEditor 4 disabled.

CKEditor 5 disabled.

/**
 * Implements hook_form_BASE_FORM_ID_alter().
 */
function example_form_node_page_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  $form["body"]["widget"][0]["#disabled"] = TRUE;
  $form["body"]["widget"][0]["#format"] = 'ckeditor5_filter';
}
Feature request
Status

Closed: duplicate

Version

11.0 🔥

Component
CKEditor 5 

Last updated about 1 hour ago

Created by

🇦🇺Australia gordon Melbourne

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024