Closed asolove closed 3 years ago
Oh dear god yes!!
@ds26gte do you have any more context/memory of the issue or how to reproduce why we needed this?
https://github.com/brownplt/code.pyret.org/commit/a365632a56f1659d1e7bb88624f08c67647fb2e8
I vaguely recall that CodeMirror tends to not to like to extend to the full vertical height of its container, and occasionally Shenanigans must be employed to convince it to stay the height of the window -- I don't think a pure-CSS solution sufficed, and the CM state would become stale. If I'm recalling that correctly, then this code makes sense and then flipping scrollHeight to offsetHeight makes sense as well...
Merging because it's obviously a fix, so no reason to wait.
This addresses the issue raised in #384.
The minimal change here was to use
offsetHeight
instead ofscrollHeight
so we no longer count the height of the absolutely-positioned menu.A major question I have is in what case this code is needed at all. Seems like the same goal could likely be met in CSS and I don't understand in what case the toolbar is larger than the CSS size and requires running this code dynamically on all scroll/resize events. If someone can explain that, I'd be happy to take a crack at a more-complete solution.