mirror of
https://github.com/outline/outline.git
synced 2026-11-27 07:58:51 +03:00
* fix: Heading anchor widget breaking IME composition The heading anchor was passed to Decoration.widget as an already-mounted element. Prosemirror can only reuse a widget when the decoration is the same object or the previous toDOM has no parent, so neither held once the button was in the document. Every doc change therefore rebuilt the widget desc and set updater.changed, forcing a rewrite of the heading contents on each keystroke. Rewriting the DOM around an active composition drops text an IME is still composing, which paragraphs never hit as they have no widget. The decoration key was also derived from the node position, so reuse broke whenever content before a heading changed length, including remote edits from another collaborator. Pass a factory and use a position independent key. Keys are only compared against the desc at the same index in the same parent nodeview, so a constant key is scoped per heading, matching the "space" widget alongside it. * Remove excessive tests