fix auto-scroll calculation

When the child nodes of a node exceed the container height, the top node should stay in view.