Added child elements to the active text editor lose their scrollTop property when they are scrolled out of view.
Hydrogen a popular atom package adds a React Component inline to the text editor to view results from external code execution through jupyter kernels.
This React Component contains a standard div element (not an immediate child but down the sub tree) that if their is enough output can scroll.
If you scroll inside of the element and then scroll down the text editor for it to fall out of view and be temporarily removed from the DOM. If you scroll back up that scroll position inside the element is lost.
Run Cellcommand from hydrogen on the code below with about 50 extra new lines
for i in range(1000): print(i)
Expected behavior: Everything to look the same
Actual behavior: Scroll top of the result view has been set to 0 upon removal and adding back to the active DOM
Reproduces how often: 100% of the time
You can get this information from copy and pasting the output of
atom --version and
apm --version from the command line.
Also, please include the OS and what version of the OS you're running.
Atom : 1.37.0
Chrome : 61.0.3163.100
Node : 8.9.3
This isnt platform specific either, and I don't believe its a hydrogen problem.
I believe this is a problem with how etch processes the render of React Components or how it stores html nodes when removing them. But I understand its more complex than that.