bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Unable to programmatically stop popover from showing

Open 29er opened this issue 8 years ago • 1 comments

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
     }   
}

...

29er avatar Feb 16 '17 16:02 29er

Easiest way to have a mouse-event using uib-popover Look at the below working example ! https://plnkr.co/edit/9oMYadXPNJcRPrig71iF?p=preview

VenkatRamReddyK avatar Nov 20 '17 22:11 VenkatRamReddyK