Added hot fix that helps popup button show menu in proper position if it can't fit in proposed rect