Open mbechev opened 2 months ago
We also noticed this. We use Popover inside a Grid. The showOn attribute is conditionally enabled (changed from 'none' to 'click'). It stops working when the grid's data is updated.
Our workaround is to set showOn to 'none'. We then pass the anchor to the click event handler. We store the previous anchor and call hide() on that before calling show() on the new anchor. All is not rosy though because You also have to manually deal with outside click.
It would be amazing if this bug was fixed.
Attached is a tiny app that reproduces the bug. But I think the stackblitz @mbechev provided is probably more useful.
Describe the bug If the
showOn
property of the Popover anchor is updated dynamically, the new value is not respected by the Popover.To Reproduce Update the
showOn
property value from 'hover' to 'none' using a custom button.https://stackblitz.com/edit/angular-md8eds-w8rtlv?file=src%2Fapp%2Fapp.component.ts
Workaround Hide and show the anchor with
ngIf
: https://stackblitz.com/edit/angular-md8eds-7pqb5x?file=src%2Fapp%2Fapp.component.ts