Problem/Motivation

We are using the style plugin to allow content editors to easily apply some classes for styling reasons. For example some buttons styles to an a tag:

a.btn.btn-primary|Primary Button
a.btn.btn-outline-primary|Primary Outline Button
a.btn.btn-secondary|Secondary Button

With CKE 4 it was possible to simply click on some part of the a tag and then select the style. Now with CKE5 this does not work anymore properly. Only if the whole link text is selected I can properly apply a style and the classes are added.

Steps to reproduce

- Use some stlyes in the editor, e.g:

a.btn.btn-primary|Primary Button
a.btn.btn-outline-primary|Primary Outline Button
a.btn.btn-secondary|Secondary Button

- Add some text via the edior
- add a link, have the curser on some parts of it (no selection)
- try to apply the "Primary Outline Button" style
- try to aplly a different style
- try to remove the style again

Proposed resolution

It should work as easily as with CKE 4

Remaining tasks

User interface changes

API changes

Data model changes

none

Release notes snippet

Comments

Schoenef created an issue. See original summary.

schoenef’s picture

Issue summary: View changes
schoenef’s picture

StatusFileSize
new90.85 KB

I added a screenshot to further illustrate the issue:

Error illustration

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)

Could you record a screencast demonstrating the problem? That'd really help! 🙏

schoenef’s picture

StatusFileSize
new10.38 MB

Hi @wim-leer,

I added a screencast illustrating the problem - it's mainly a usability issue in my eyes.

The style config used in the screencast is the same as above:

a.btn.btn-primary|Primary Button
a.btn.btn-outline-primary|Primary Outline Button
a.btn.btn-secondary|Secondary Button

Thx a lot!
Andreas

wim leers’s picture

Assigned: Unassigned » wim leers
Status: Postponed (maintainer needs more info) » Active
wim leers’s picture

Title: style plugin assignment is not working properly » [Style] style plugin assignment is not working properly
Version: 9.5.x-dev » 11.x-dev
Assigned: wim leers » Unassigned
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs manual testing
Related issues: +#3376167: [upstream] [GHS] Add style to anchor leads to unusable behavior, +#3406732: Update CKEditor 5 to 40.2.0

AFAICT this was a duplicate of #3376167: [upstream] [GHS] Add style to anchor leads to unusable behavior, which was fixed by #3406732: Update CKEditor 5 to 40.2.0. Can you still reproduce this on Drupal 10.2? 🙏

wim leers’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)