Hey everyone!
First and foremost, thank you not only for this amazing library, but also helping me learn a transaction based architecture. I love it.
I am incorporating React into my NodeView
s via portals. I pass a callback into the NodeView
’s constructor that can add/remove a portal to an array in the main component, which renders the portals.
One example of such a NodeView
is a timestamp view that displays a certain date and can be adjusted via a dropdown.
Here’s my problem:
- I can have as many of these timestamp views in one paragraph.
- It also works if I have two paragraphs.
- But for any paragraph that is not the first or the last, I can’t open the dropdown anymore.
What I’ve observed:
- I checked which methods are called in the
NodeView
. Interestingly enough, it’s not theupdate
method, but all constructors and destroy methods that are called any time I click on the component. - I don’t understand this behavior at all. I am not updating any attribute when opening/closing a dropdown (though, I set an internal React state to track the dropdown’s state).
Additional details:
- Since I don’t want any events to be handled by ProseMirror when making entries in the
NodeView
(e.g., pressing backspace),stopEvent
returnstrue
for all events.