Problem/Motivation

The preview functionality does not work. The JS script is not working as expected.

Steps to reproduce

On a Drupal 9 site, install the module. Go to the "/admin/appearance/settings" page and select a theme in the menu. Check the field " Enable auto preview". It should load an iframe with the homepage content below.

Proposed resolution

With Drupal 9, the rendered form field ids are different and the JS could not locate them.
The script try to find '#edit-autopreview-enabled' and '#edit-plaintext-enabled'.
So we have to add specific id attributes to the fields in the "css_editor_form_system_theme_settings_alter" function.

Issue fork css_editor-3294715

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

madchris created an issue. See original summary.

madchris’s picture

Status: Active » Needs review
kwheeler’s picture

This patch fixed live preview for me. Thanks!

podarok made their first commit to this issue’s fork.

podarok’s picture

Version: 2.0.x-dev » 2.0.2
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.