Question about protectLocalComposition in prosemirror-view


There is no problem input in non-links.

The dom structure:



The dom structure:


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.