codemirror / dev

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

Editor scrolled if an update occurs before the first animation frame #1366

Closed s-cork closed 5 months ago

s-cork commented 5 months ago

Describe the issue

We had this problem and isolated it to the linked example

If an update occurs before the first animation frame after creating the editor then the editor is partially scrolled

Browser and platform

NA

Reproduction link

https://codemirror.net/try/?c=aW1wb3J0IHtFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgoKY29uc3QgdiA9IG5ldyBFZGl0b3JWaWV3KHsKICBkb2M6IG5ldyBBcnJheSgxMDAwKS5maWxsKCkubWFwKChfLGkpID0+IGBMaW5lICR7aSsxfWApLmpvaW4oIlxuIiksCiAgcGFyZW50OiBkb2N1bWVudC5ib2R5Cn0pCgovLyBJZiB3ZSBkbyB0aGlzIHN5bmNocm9ub3VzbHksIGVkaXRvciBzdGFydHMgc2Nyb2xsZWQKdi5kaXNwYXRjaCh7fSkKCi8vIEJ1dCBpZiB3ZSBkbyBpdCBsYXRlciBpbnN0ZWFkLCBldmVyeXRoaW5nIGlzIGZpbmU6CnJlcXVlc3RBbmltYXRpb25GcmFtZSgoKSA9PiB7CiAgdi5kaXNwYXRjaCh7fSk7Cn0pOw==

marijnh commented 5 months ago

Attached patch seems to resolve this.

s-cork commented 5 months ago

Thanks @marijnh - do you know why the default was originally true?

and can we request a version bump 🙏

marijnh commented 5 months ago

do you know why the default was originally true?

No. It seems to have been set that was in the patch where I initially added the field, but I can't think of a good reason I did that. The bug fixed by that patch remains fixed with this change.

I've tagged 6.26.3