You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use a node view that contains a list of items. These items can be indented and outdented via ProseMirror's helper commands sinkListItem and liftListItem. We noticed that these transactions don't work well with react-prosemirror's rendering cycle.
When ProseMirror executes the scrollIntoView transaction at the very end of the command, the node view is still detached from the DOM.
CleanShot.2023-12-18.at.17.04.13.mp4
Due to that, the scroll calculation doesn't lead to the expected result. For example, if you lift/sink an item at a position further down in the document, it always scrolls the page back to the very top. This is how it behaves with and without node views:
Issue
We use a node view that contains a list of items. These items can be indented and outdented via ProseMirror's helper commands
sinkListItemandliftListItem. We noticed that these transactions don't work well withreact-prosemirror's rendering cycle.When ProseMirror executes the
scrollIntoViewtransaction at the very end of the command, the node view is still detached from the DOM.CleanShot.2023-12-18.at.17.04.13.mp4
Due to that, the scroll calculation doesn't lead to the expected result. For example, if you lift/sink an item at a position further down in the document, it always scrolls the page back to the very top. This is how it behaves with and without node views:
CleanShot.2023-12-18.at.16.58.34.mp4
How To Reproduce
I added a setup that reproduces the issue here: https://stackblitz.com/edit/stackblitz-starters-wu7os2