bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Popover randomly closes immediately after opening when using `popover-is-open`

Open andrastothtw opened this issue 9 years ago • 2 comments

Bug description:

When setting value to popover-is-open popover shows and hides immediately. But not always.

Steps to reproduce the issue:

  1. I have a callback from an external module when its input receives focus (property of angucomplete-alt version 3.0.0) focus-in="vm.autocompleteFocus(true)"
  2. autocomplete focus sets tooltipIsOpen to true:
 autocompleteFocus(value) { this.tooltipIsOpen = value; }
  1. pop-over detects changes and...
popover-is-open="vm.tooltipIsOpen"
popover-trigger="none"

Result:

Tooltip opens and closes.

What I tried to overcome it

When I created a setter and added a log message inside it turned out, that pop-over set tooltipIsOpen's value at least once but sometimes twice.

I then tried to overcome 2-way binding with popover-is-open="!!vm.tooltipIsOpen", but it did not work.

I noted one more thing; when I added a breakpoint to the first line of this function the thing started to work as expected:

function assignIsOpen(isOpen) {
  if (isOpenParse && angular.isFunction(isOpenParse.assign)) {
    isOpenParse.assign(scope, isOpen);
  }
}

Version of Angular, UIBS, and Bootstrap

Angular: 1.5.11

UIBS: 2.5.0

Bootstrap: 3.3.7

andrastothtw avatar Sep 22 '17 15:09 andrastothtw

Solved: never forget to put '' around none in popover-trigger="'none'" I was doing it with popover-trigger="none" and it caused the problems.

andrastothtw avatar Sep 25 '17 12:09 andrastothtw

Thank you @andrastothtw for this. Spent 3 hours banging my head over this issue. You saved the day.

prathik457 avatar Oct 16 '17 18:10 prathik457