Command doesn't properly set the enable/on property

Created on 1 November 2024, 14 days ago

Problem/Motivation

When selecting anything in the WYSIWYG, that is not a paragraph embed, the embed button should be disabled. At the moment, you can select any type of "widget", and the button stays enabled.
If you then click the embed button, it will crash, as it isn't acting on a "embeddedParagraph".

Steps to reproduce

Insert any type of widget (eg, from https://www.drupal.org/project/entity_embed ) and select it. You would be able to still click on the Paragraph Embed button, and trigger an error.

Proposed resolution

In js/ckeditor5_plugins/embeddedParagraph/src/command.js replace the logic from `refresh` with something similar to how https://www.drupal.org/project/url_embed does it, for example.

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇫🇷France bellesmanieres

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024