Make sure cursor is inside scrollbox when passing clicks

Closes #765