#1278·dev

iOS/Safari: Vertical scrollbar broken with many wrapped lines

Author: personalizedrefrigeratorCreated Oct 6, 2023Updated Apr 15, 2026

Describe the issue

Long-pressing and dragging the vertical scrollbar on iOS causes the document to start scrolling, then jump back to its original position.

This only seems to happen when line wrapping is enabled -- compare https://personalizedrefrigerator.github.io/personalSite/demos/codemirror_ios_scrolling/ with https://personalizedrefrigerator.github.io/personalSite/demos/codemirror_ios_scrolling/?no-wrap .

Firefox on Linux seems to also have trouble scrolling to the end of a document when line wrapping is enabled — dragging the scrollbar from the top of the editor to the end does not scroll to the last line.

Browser and platform

Safari on iOS 17.0.2

Reproduction link

https://codemirror.net/try/?c=aW1wb3J0IHtFZGl0b3JWaWV3LCBiYXNpY1NldHVwfSBmcm9tICJjb2RlbWlycm9yIjsKCmNvbnN0IGh1Z2VEb2NMaW5lcyA9IFsKICAgICdUaGlzIGlzIGEgdmVyeSBsb25nIGRvY3VtZW50LiBUcnkgZHJhZ2dpbmcgdGhlIHZlcnRpY2FsIHNjcm9sbGJhciBvbiBpT1MuJwpdOwoKZm9yIChsZXQgaSA9IDA7IGkgPCAxMF8wMDA7IGkrKykgewogICAgaHVnZURvY0xpbmVzLnB1c2goCiAgICAgICAgYExpbmUgJHtpfS4gSXQgc2VlbXMgdGhhdCBsaW5lcyBtYXkgbmVlZCB0byBiZSBsb25nIGVub3VnaCB0byB3cmFwIHRvIHRyaWdnZXIgdGhlIGJ1Zy4gYCArIAogICAgICAgIGBBcyBzdWNoLCBlYWNoIGxpbmUgaXMgbG9uZy4gTG9uZyBlbm91Z2ggdG8gY2F1c2UgdGhlIGxpbmUgdG8gd3JhcC4gYCArCiAgICAgICAgYEl0IHNlZW1zIHRoYXQgdGhpcyBtaWdodCBub3QgYmUgYW4gaXNzdWUgb24ganVzdCBpT1MgLS0gRmlyZWZveCBvbiBMaW51eCBhbHNvIHNlZW1zIHRvIGAgKwogICAgICAgIGBoYXZlIHRyb3VibGUgd2hlbiBkcmFnZ2luZyB0aGUgc2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