ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

CKEditor requires a text style in order for the styles dropdown to work

Open HAWilliams01 opened this issue 1 year ago • 1 comments

Reproduction steps

Craft CMS version 5.5.5, CKEditor version 4.4.0

  1. CKEditor is already installed and working properly.
  2. Add the styles dropdown to an existing CKEditor config
  3. Remove the default "Marker" style from the definitions array {"name": "Marker", "element": "span", "classes": ["marker"]}`
  4. Save the config and try to edit a CKEditor field
  5. The Styles dropdown is grayed out and does not open to allow the user to add styles that are specified in the config.

It appears the Styles needs a text style type in order to work correctly. CKEditor is grouping these automatically based on the docs.

Current behavior

The styles dropdown is grayed out and not clickable if a text style type is not added to the definitions array

Broken state "definitions": [ { "classes": [ "red-heading" ], "element": "h2", "name": "Red heading" }, { "classes": [ "vibrant-code" ], "element": "pre", "name": "Vibrant code" } ]

Expected behavior

The dropdown is usable regardless of what type of custom styles are defined, as long as the json is valid.

Working state: "definitions": [ { "classes": [ "marker" ], "element": "span", "name": "Marker" }, { "classes": [ "red-heading" ], "element": "h2", "name": "Red heading" }, { "classes": [ "vibrant-code" ], "element": "pre", "name": "Vibrant code" } ]

Definition of Done

  • Please leave this field for us. We will fill it during the backlog refinement session.

Relevant debug data


Other details

No response

User agent

Chrome Version 131.0.6778.86 (Official Build) (arm64)

HAWilliams01 avatar Dec 04 '24 16:12 HAWilliams01

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

CKEditorBot avatar Dec 05 '25 23:12 CKEditorBot