Skip to content

Add option to force model.deleteContent to remove exactly the given range #18448

@scofalik

Description

@scofalik

📝 Provide a description of the improvement

Current, model.deleteContent() tries to fix the range-to-remove to provide better UX. If the range-to-delete is as follows:

<p>[Foo</p><p>]Bar</p>

Then deleteContent() will act like the range ends in the first paragraph:

<p>[Foo]</p><p>Bar</p>

Which is a special handling for "triple click" behavior, where a lot of times user would not realize what selection they made and that they are about to merge the following paragraph (with "Bar").

However, in some cases, you want to remove exactly the range that you passed. One such case is track changes integration, where e.g. the insertion suggestion marker may be like in the first example, and upon discard you want to revert the whole insertion, so you don't want to shrink the range-to-delete. Right now, in track changes mode, if you write something, press enter and discard the suggestion, you will be incorrectly left with an empty paragraph.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions