Skip to content

After undo/redo, new text is inserted at the end #912

@cengels

Description

@cengels

Expected Behavior

When a text change is undone or redone, the selection should stay where the caret is so that subsequent text insertions originate from the caret position.

Actual Behavior

When a text change is undone or redone, the selection jumps to the end of the document (from what I can tell, neither caretPosition nor anchor are affected). Subsequent text insertions (if the caret is not manually moved in the meantime) place new text at the end rather than at the caret position.

Note that, from what I can tell, this only occurs on text changes, not style changes.

Reproducible Demo

Occurs as-is in the latest version (revision c9a002b) of the RichTextDemo.

Steps:

  1. Open the RichTextDemo
  2. Write some text, preferably with multiple paragraphs
  3. Change some text in a position that is not the end (removing or adding characters both works)
  4. Undo the change
  5. Type another character
  6. The new character is inserted at the very end of the document

Might be related to #780 / #785.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions