Prevent scrolling

Issue:- We are using prosemirror as our text editor. I am implementing a sticky behavior for the Editor using position: sticky for Comments in my app. The issue I am facing is when I scroll up or down and then initialize the Editor and start typing - it will scroll the content and push it all the way down. On doing some research I see the function scrollRectIntoView has this logic to do window.scrollBy(x,y) - this is where the scroll happens…I want to see if we can prevent this behavior for certain cases.

1 Like

The handleScrollToSelection prop might help here.

On Android it seems like the webview scrolls anyway, ignoring handleScrollToSelection

Actually, I never even see handleScrollToSelection called.

@marijn could you clarify when it’s supposed to be called? I studied the code a bit but I still don’t really understand. I’ll keep looking though.