codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.94k stars 376 forks source link

iOS devices cannot scroll properly after enabling line wrapping #1460

Closed mc-public closed 2 weeks ago

mc-public commented 2 weeks ago

Describe the issue

For the simplest example, only loading the EditorView.lineWrapper extension. In this case, scrolling will not work properly for longer texts. For example, the following large document example: https://codemirror.net/examples/million/

When scrolling, the scrollbar jumps up and down, making it impossible to drag the scrollbar normally; when quickly dragging the page downwards with a finger, the scrolling is always interrupted.

In real situations, this happens even with thousands of lines of text. However, if automatic line wrapping is turned off, everything works fine.

This issue cannot be reproduced on macOS.

Browser and platform

WKWebView and Safari, on iOS

Reproduction link

No response

mc-public commented 2 weeks ago

For those who may encounter this issue, placing the CodeMirror scroll container at the root, i.e., using the top-level WKScrollView of WKWebView as the scroll view, will prevent this situation from happening. This should be an issue with Apple WebKit.