Skip to content

Unlinking fails for middle block when more than 2 blocks are selected #8030

Closed
@oleq

Description

@oleq

📝 Provide detailed reproduction steps (if any)

  1. Create 3 blocks, e.g. used 3 list items.
  2. Select all of them and create a link.
  3. Click "Unlink" in the link actions balloon.

✔️ Expected result

All items should be free of the link.

❌ Actual result

The middle item is still linked.

I briefly checked this and the 3 ranges Writer#removeAttribute() works on internally are looking fine. It feels like the bug is in the setAttributeOnRange() helper. When I logged the following

console.log( val.item, valueBefore, valueAfter );

in the walker inside it was

TextProxy {textNode: Text, data: "tem", offsetInText: 0} undefined "foo"
Element {parent: RootElement, _attrs: Map(2), name: "listItem", _children: NodeList} undefined undefined
TextProxy {textNode: Text, data: "third", offsetInText: 0} undefined "foo"

because the walker created with shallow: true. When I got rid of this option, the bug is gone and more items are logged

TextProxy {textNode: Text, data: "tem", offsetInText: 0} undefined "foo"
Element {parent: RootElement, _attrs: Map(2), name: "listItem", _children: NodeList} undefined undefined
TextProxy {textNode: Text, data: "second item", offsetInText: 0} undefined "foo"
Element {parent: RootElement, _attrs: Map(2), name: "listItem", _children: NodeList} "foo" undefined
TextProxy {textNode: Text, data: "thir", offsetInText: 0} undefined "foo"

P.S. The bug could also be in getMinimalFlatRanges().

📃 Other details

  • Browser: Chrome
  • OS: Mac
  • CKEditor version: v22.0.0

It's not a regression, I checked in v16.0.0 and it's all the same.


If you'd like to see this fixed sooner, add a 👍 reaction to this post.

Activity

added
type:bugThis issue reports a buggy (incorrect) behavior.
domain:ui/uxThis issue reports a problem related to UI or UX.
squad:coreIssue to be handled by the Core team.
on Sep 4, 2020
panr

panr commented on Sep 11, 2020

@panr
Contributor

This bug appeared after the changes from this commit: 0ed523e#diff-a3ae70b600cbe7a13e75771a6a5519acR81

I would label it as type:regression. However, I know some of those changes were intentional...

oleq

oleq commented on Sep 11, 2020

@oleq
MemberAuthor

Are you sure this is the right commit? Because I'm experiencing the same bug in releases as old as v16.0.0.

panr

panr commented on Sep 11, 2020

@panr
Contributor

git bisect told me that this is the one ;-P Reverting that commit fixes this issue for my case (regarding multi-block link marker issue).

added this to the next milestone on Sep 14, 2020
modified the milestone: next on Nov 10, 2020
modified the milestones: nice-to-have, iteration 38 on Nov 20, 2020
self-assigned this
on Nov 20, 2020
added a commit that references this issue on Nov 23, 2020

Merge pull request #8495 from ckeditor/i/8030

3d86dad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

domain:ui/uxThis issue reports a problem related to UI or UX.package:enginepackage:linksquad:coreIssue to be handled by the Core team.type:bugThis issue reports a buggy (incorrect) behavior.

Type

No type

Projects

No projects

Relationships

None yet

Participants

@oleq@niegowski@panr@pomek@Mgsy

Issue actions

    Unlinking fails for middle block when more than 2 blocks are selected · Issue #8030 · ckeditor/ckeditor5