Question about protectLocalComposition in prosemirror-view

20240630-102400

There is no problem input in non-links.

The dom structure:

<em>
  <Decoration.inline>*</Decoration.inline>
  text
  <Decoration.inline>*</Decoration.inline>
</em>

20240630-102331

The dom structure:

<a>
  <Decoration.inline>[</Decoration.inline>
  text
  <Decoration.inline>]</Decoration.inline>
</a>

Composition node keep changing in links, and prev input keept in dom.

When I delete the code within the red box or directly change the topNode passed to CompositionViewDesc to node, it works as i expected.

What is the use case of those code and can we simply remove those code?

I originally thought ProseMirror didn’t have a GitHub issue page, but I just found it. Next time, I’ll check there first to see if there are any duplicates.