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