Data attributes of a new link are always applied to the FIRST link

Created on 3 November 2025, 9 days ago

Problem/motivation

Data attributes of a new link are always applied to the FIRST link

Steps to reproduce

CKEditor5 + Linkit only (it's not other module's issue)

  1. create a new link, update href, displayed text etc
  2. create another link link, update href, displayed text etc
  3. create third link link, update href, displayed text etc
  4. update 2nd's link display text

result: data attributes are applied to first link! see video: https://youtu.be/bY3Kpu21NGc

Proposed resolution

issue is in getClosestSelectedLinkElement() in util.js - it alsways returns first link

This module uses Gitlab CI for automated testing of proposed code changes. To contribute code changes, create a merge request. Patch files will not trigger automated testing and are not sufficient for review.
🐛 Bug report
Status

Active

Version

7.0

Component

Code

Created by

🇦🇺Australia jannakha Brisbane!

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024