If auto height mode is swicthed on grid expands to prevent vertical scrolling, and shrinks not to occupy external place.