bootstrap
bootstrap copied to clipboard
Unable to programmatically stop popover from showing
Hi, supposedly you are able to use the popover-is-open property to programmatically stop a popover from showing ? I have tried several ways to achieve this but no luck. An example below just checks to see if another popover exists on the Dom, and should stop the current one from opening. I also tried using popover-is-enabled . Ive tried event.preventDefault, _return false, _, etc and pretty much any variation with no luck. Please give assistance. thanks!
<span class="cell-popover-icon"
uib-popover-template="'my.html'"
popover-trigger="none"
popover-placement="top"
popover-is-open="$ctrl.popoverIsOpen"
popover-append-to-body="true"
ng-click="$ctrl.toggle($event)">
</span>
Angular: ...
toggle( event ) {
const anotherPopover = document.querySelector('.my-popover')
if( anotherPopover ){
this.popoverIsOpen = false
return false
} else {
this.popoverIsOpen = !this.popoverIsOpen
}
}
...
Easiest way to have a mouse-event using uib-popover Look at the below working example ! https://plnkr.co/edit/9oMYadXPNJcRPrig71iF?p=preview