Search layout: fix tail position bug on window resize