Set position fixed or absolute for items dropdown based on overflow of parent elements