scrollMargin and scrollThreshold not working on IOS #137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello guys. First of all, thanks for your work.
I am building an application where I am using the Tiptap editor witch based on the Prosemirror editor. I have a floating menu that is under the cursor and I want it to always be shown above the keyboard on mobile devices and not hide under it. So I used scrollMargin and scrollThreshold.
And it works well when pressing
enter, arrow up and arrow downkeys on desktop, orenterkey on android. But doesn't work at all on iOS.Expected behavior:
When pressing Enter, the cursor should be 80px above the keyboard
Here are examples:
IOS

Android

Can you fix it? Thanks!
I looked into this and it appears that Mobile Safari just reports the entire document size for
innerHeight, so ProseMirror's scrolling code doesn't really know how large the actual viewport is. I searched the web a bit but didn't find an obvious workaround for that. Thus, while the native scrolling-into-view works, ProseMirror's own logic, which takes the scrollMargin into account, is pretty much disabled.