Fix issue where scrollbar would flicker when shrinking the screen