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

Scroll position not updated when editor size change #6819

Closed
lishid opened this issue Nov 9, 2021 · 1 comment
Closed

Scroll position not updated when editor size change #6819

lishid opened this issue Nov 9, 2021 · 1 comment

Comments

@lishid
Copy link
Contributor

lishid commented Nov 9, 2021

Steps to repro

  • Go to https://codemirror.net/
  • Run console code editor.setValue(new Array(100).fill('test').join('\n'));
  • Scroll editor down.
  • Run console code editor.setValue('test');
  • Run console code editor.setValue(new Array(100).fill('test').join('\n'));

Expected results

Editor fully scrolled to the top

Observed results

Scroll bar shows editor scrolled to the bottom, while text seems to be scrolled to the top.

Notes

Could be a recent regression

Screencap

test

marijnh added a commit that referenced this issue Nov 10, 2021
To avoid it reinitializing in a scrolled position on Chrome

Issue #6819
@marijnh
Copy link
Member

marijnh commented Nov 10, 2021

This doesn't happen on Firefox. Seems Chrome somehow 'smartly' restores the scrollbar position here, which isn't a good idea. Attached patch should fix it.

@marijnh marijnh closed this as completed Nov 10, 2021
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