Problem/motivation

Ckeditor5 link url form submit on enter keypress or non-autocomplete selection does not remove existing data-* attributes.

This is a problem when changing a link from one that should be linkit url converted to a link that should not.

example

Steps to reproduce

1. Create a link from an autocomplete suggestion by mouse clicking on it.
View source to see that data-* attributes were set.

2. Edit the link, change the link by typing in a new value such as "google.com" and keypress enter.
View source to see that the href is now "google.com" but data-* attributes for previous entity still exists.

Comments

drpldrp created an issue. See original summary.

drpldrp’s picture

StatusFileSize
new322.28 KB
drpldrp’s picture

Issue summary: View changes
drpldrp’s picture

Issue summary: View changes
drpldrp’s picture

Issue summary: View changes
drpldrp’s picture

Issue summary: View changes
drpldrp’s picture

Issue summary: View changes
StatusFileSize
new1.46 KB
drpldrp’s picture

StatusFileSize
new1.27 KB
drpldrp’s picture

This one might be the cleanest but relies on addEventListener('input'.

drpldrp’s picture

mark_fullmer’s picture

Title: link url keypress enter does not remove attributes » When [Enter] key is used to replace a link, the previous link's attributes are not removed

  • mark_fullmer committed 803fd009 on 6.1.x
    Issue #3443845 by drpldrp, mark_fullmer: When [Enter] key is used to...
mark_fullmer’s picture

Status: Active » Fixed

I was able to reproduce the problem, verified the fix, and reviewed the logic of the code change. Thanks for reporting and for the fix!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.