Problem/Motivation

When changing attributes on a link, link is split in editor view (see screenshots/video)

Steps to reproduce

Drupal 11/10:

- install/enable CKEditor 5 Link Attributes
- add group: Button alert and attributes: class|btn btn-danger
- add group: Button info and attributes: class|btn btn-info
- save

in editor:
- create a link, set attribute to Button alert, save, refresh
- edit same link, add to selected attribute Button info,
- toggle Button alert

result:
Link splits, view becomes unusable,
HTML looks fine
looks like it happens when user selects multiple classes and then unselects one while others are still active.

Clean installation, no other modules which affect CKEditor5 Editor's links are enabled.

Proposed resolution

Move caret to the end of selection after each attribute change?

Remaining tasks

Fix issue

User interface changes

None

API changes

TBA

Data model changes

TBA

CommentFileSizeAuthor
screen-capture.mov3.93 MBjannakha
split-button.png62.87 KBjannakha
config.png129.78 KBjannakha

Comments

jannakha created an issue. See original summary.

salmonek’s picture

Hi Jen

It looks like CKEditor's decorators doesn't work well in case there are multiple definitions (called groups in our config) with shared class - btn in your case. I have verified that with such config there is an issue you reported, also after moving btn class to a separate group, plugin started to work correctly.

There is a ticket on CKEditor's github related to issues with config that have multiple decorators with shared class.
I'll add a demonstration of the issue you found to that ticket.

jannakha’s picture

Status: Active » Postponed

Thanks Wojciech!
I'll move this issue to Postponed until CKEditor5's github issue is resolved (#2).
Happy holidays!