Fixed a flickering bug caused by scrolling into panels for the first time