Problem/Motivation

Discovered in #3201820: Manually test that CKE 5 can be used in off-canvas

In core/misc/dialog/off-canvas.reset.css, there is a style that sets most elements within the dialog to all: initial;. This overrides the user-modify property, and makes the element (and its children) non-editable.

I created a codepen to demonstrate example of how all: initial; breaks contenteditable (and how to potentially fix it) https://codepen.io/bbbenjamin/pen/poRNJwM

Steps to reproduce

In Chrome or Firefox: (other browsers may be impacted, but these are confirmed)
Use inspector to add a contenteditable div in the main canvas. It will be editable
Use inspector to add a contenteditable div inside an off-canvas dialog. It won't be editable.

Proposed resolution

The solution would need to target any contenteditable elements AND its child elements. Adding a rule to do this in off-canvas.reset.pcss.css shouldn't be too complicated, but it would be nice to find a solution that doesn't balloon the filesize of the off-canvas.reset.css file it compiles to.

Something like this should work

#drupal-off-canvas [contenteditable],
#drupal-off-canvas [contenteditable] * {
  -webkit-user-modify: read-write;
  -moz-user-modify: read-write;
}

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

bnjmnm created an issue. See original summary.

Wim Leers’s picture

Issue tags: +browser compatibility
bnjmnm’s picture

Status: Active » Closed (duplicate)

Closing as duplicate. This is being addressed as part #3201820: Manually test that CKE 5 can be used in off-canvas, after spending time in that issue it's apparent that splitting this bug into its own scope would make #3201820 really difficult to review.

bnjmnm’s picture

Title: Off Canvas reset breaks contenteditable functionality in Webkit browsers » Off Canvas reset breaks contenteditable functionality in several browsers
Issue summary: View changes
Status: Closed (duplicate) » Active

Blame multitasking - I closed this as a duplicate of #3201820: Manually test that CKE 5 can be used in off-canvas, but that's an issue fixing it in CKEditor 5. This is a core issue so other uses of contenteditable do not break in off-canvas.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mherchel’s picture

Note that this is likely fixed for Drupal 10 in #3291797: Refactor Drupal 10 settings tray / off-canvas to use modern CSS.

Can we verify this is still a problem in D10?

mherchel’s picture

Status: Active » Postponed (maintainer needs more info)

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)
Issue tags: +Bug Smash Initiative

Since there hasn't been a follow up to #10 going to close for now. If still not fixed in D10 please reopen.