fix(popup): if popup is taller than the window, shrink the popup body and make it scrollable. Closes #1679