Detect visibility of the tab bar more robustly
Don't reset scroll position while the tab bar is invisible (#646)