Typing inside deleted text (e.g. insert "AB" into deleted region) can produce nested tracked marks and invalid change ranges. Symptoms include nested <ins>/<del> marks (nested marks or the actual issue is not immediately visible as we use excludes: 'tracked_insert tracked_delete', in the schema.
Steps to reproduce:
- Open a document with tracked deletion covering a word/phrase.
- Place cursor inside that deleted text and type two characters (e.g. "AB").
- Observe resulting DOM/marks
Observed the same behavior with apps created using @handlewithcare/react-prosemirror and regular ProseMirror libraries
Actual:
- Insert and delete marks become nested or overlapped (e.g. AB
ample text).
- fixInconsistentChanges runs and applies marks using stale positions, producing invalid change ranges and warnings.
Expected:
- New inserted characters become a separate, correct insert change (e.g. AB) adjacent to deletes.
Root cause:
fixInconsistentChanges was using a changeSet built before mergeTrackedMarks ran, so it operated on stale change metadata and attempted fixes with outdated ranges.
Typing inside deleted text (e.g. insert "AB" into deleted region) can produce nested tracked marks and invalid change ranges. Symptoms include nested
<ins>/<del>marks (nested marks or the actual issue is not immediately visible as we useexcludes: 'tracked_insert tracked_delete',in the schema.Steps to reproduce:
Observed the same behavior with apps created using
@handlewithcare/react-prosemirrorand regular ProseMirror librariesActual:
ample text).Expected:
Root cause:
fixInconsistentChanges was using a changeSet built before mergeTrackedMarks ran, so it operated on stale change metadata and attempted fixes with outdated ranges.