If the doc is only one-line, scrollPastEnd doesn’t add scrollbars. As soon as another line is added, the scrollbars appear.
It seems like scrollPastEnd should always add scrollbars, whether the doc is empty or bigger than the viewport.
If the doc is only one-line, scrollPastEnd doesn’t add scrollbars. As soon as another line is added, the scrollbars appear.
It seems like scrollPastEnd should always add scrollbars, whether the doc is empty or bigger than the viewport.
Looking at the extension, it subtracts a line so it makes sense why a one line document wouldn’t scroll in that instance view/src/scrollpastend.ts at a0a5ed946cfdfde61dcf33b131d551136378ccf9 · codemirror/view · GitHub
Maybe a little extra logic for not subtracting the line height if there’s only one line?
This is intentional. It creates precisely enough space so that, when you scroll all the way down, you still have a single line in view. Why is this an issue?
The lack of overscroll on single line documents causes scrollbars to pop in and out when resizing.
Is there another way to ensure the scrollbars remain on single-line documents?
overflow-y: scroll (rather than auto) may be what you’re looking for.