Fixes rendering of elemenets in the preview popup window

especially when header is static which can result in elements getting hidden