Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selection inset varies by document scroll position #1096

Closed
hubgit opened this issue Feb 28, 2023 · 1 comment
Closed

Selection inset varies by document scroll position #1096

hubgit opened this issue Feb 28, 2023 · 1 comment

Comments

@hubgit
Copy link
Contributor

hubgit commented Feb 28, 2023

Describe the issue

There seems to be a discrepancy between the way the selection is drawn at the top of a document and further down the document (once the top of the document is scrolled out of the top of the viewport?)

In the linked demo, making a selection at the top of the document is consistently indented:

image

When making a selection further down the document, the edges of the selection extend to the edges of the content box:

image

Browser and platform

Chrome, Firefox and Safari on macOS

Reproduction link

https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge2phdmFzY3JpcHR9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctamF2YXNjcmlwdCIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6ICJmb287XG4iLnJlcGVhdCgyMDApLAogIGV4dGVuc2lvbnM6IFtiYXNpY1NldHVwLCBqYXZhc2NyaXB0KCldLAogIHBhcmVudDogZG9jdW1lbnQuYm9keQp9KQo=

@marijnh
Copy link
Member

marijnh commented Feb 28, 2023

Attached patch should help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants