Refactoring scroll handler to fix issues.
Refactoring scroll handler to fix issues.

[#39903749] and [#40312095] should both be fixed by this.
concord-consortium/lara,concord-consortium/lara,concord-consortium/lara,concord-consortium/lara,concord-consortium/lara