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
| Comment | File | Size | Author |
|---|---|---|---|
| screen-capture.mov | 3.93 MB | jannakha | |
| split-button.png | 62.87 KB | jannakha | |
| config.png | 129.78 KB | jannakha |
Comments
Comment #2
salmonek commentedHi 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 -
btnin your case. I have verified that with such config there is an issue you reported, also after movingbtnclass 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.
Comment #3
jannakha commentedThanks Wojciech!
I'll move this issue to Postponed until CKEditor5's github issue is resolved (#2).
Happy holidays!