klembot / twinejs

Twine, a tool for telling interactive, nonlinear stories
https://twinery.org
GNU General Public License v3.0
2k stars 296 forks source link

[2.6.0+] Passage editors do not retain scroll state #1431

Open hituro opened 1 year ago

hituro commented 1 year ago

Describe the bug.

When opening more than one passage editor at a time, inactive editors (those not on top of the stack) do not retain their scroll state.

Steps to reproduce:

Create a passage long enough to scroll. Scroll it. Open a second editor. When you return the first, scroll has been lost.

Expected behavior:

Scroll state should be retained

Additional context on this problem.

No response

Twine version number

2.6.0+

Does this problem occur with the web version of Twine or the desktop app?

Desktop app

What operating system does this problem occur on?

Other

If this problem is occurring with the web version of Twine, what browser does it occur on?

Firefox

Presubmission checklist

klembot commented 1 year ago

The reason why this happens is that for performance, Twine doesn't render the code editor area unless it's visible. So we'd need to add some mechanism for remembering this when the editor goes to the background.