Hidden components take up space

Already answered here: How to hide layout if the element is getting hidden using rules - #2 by sdirix