Skip to content

deleteContent in graveyard fails #4498

Closed
ckeditor/ckeditor5-engine
#1707
@scofalik

Description

@scofalik

If deleteContent() is executed on a selection which is in the graveyard root it will fail. It's because startPos is created as a static position but since it is in the graveyard, it should be updated:

const startPos = selRange.start;
// ...
writer.remove( selRange );
// ...
mergeBranches( writer, startPos, endPos ); // <-- Incorrect `startPos` is used.

There are two possible solutions for this:

  1. Make startPos a LivePosition.
  2. Cancel deleteContent if selRange is in the graveyard.

We chose the second option because it is less prone to an error and generates no operations.

Metadata

Metadata

Assignees

Labels

package:enginetype:improvementThis issue reports a possible enhancement of an existing feature.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions