Hi y’all!
Our editor uses footnotes whose implementation is inspired by the footnote example. We use react-prosemirror, but I don’t think this is relevant for the problem we are facing.
We also use a plugin to modify the behaviour of internal links to open them inside the application. For that, we use handleClickOn()
to trigger the internal state change and handleDOMEvents()
to prevent the default behaviour. In the main editor, the plugin works well.
Yet in the subordinate footnote editor, handleClickOn()
does not fire. We suspect the following:
handleSingleClick()
runsrunHandlerOnContext()
which returnsfalse
asinside=-1
.inside=-1
is set byposAtCoords()
which uses the link’s<a>
HTMLElement aselt
and the footnote node (with the editor HTMLElement asdesc
.- But {inside:
desc ? desc.posAtStart - desc.border}
should always return-1
. The footnote editor’s parent is undefined and hencedesc.posAtStart
returns 0. It also is not aleaf
and hencedesc.border
return 1.
I frankly don’t thoroughly understand the logic around NodeViewDesc
, but this behaviour seems odd. Is there a way to avoid it?
A workaround we found is using handleClick
instead of handleClickOn
but that might have other consequences that we are unaware of.
Thank you.