Very hacky but working way to close popover