Resizing NSPopover flickers in 10.14

I have a popover which i want to resize the popover whenever click action performed. In

viewDidLayout
using
preferredContentSize
i am resizing the popover


- (void)viewDidLayout {
    self.preferredContentSize = NSMakeSize(NSWidth(tableview.frame), height);
}


this is working fine below 10.14 but in 10.14 there is flickering what could be the reason

Any help or suggestions would be more appreciated.