0

So I started making a little game using KnockoutJS. I found this nice binding handler to use with popovers: https://github.com/s-stude/knockout-popover.

The issue is that when 'initialConstructionGoing' turns to false and the content disappear, the popover is frozen. I tried making a setTimeout to make it go away but it didn't work.

<!-- ko if: initialConstructionGoing -->
<i class="fa fa-exclamation-triangle icon-gradient-warning" class="ko-popover" data-bind="popover: true, popoverOptions: { title: 'Under construction' }" ></i>
<!-- /ko -->

What would be a good approach to this issue?

Thanks!

Jeremy Dicaire
  • 4,615
  • 8
  • 38
  • 62
  • 1
    Would it work to change "popover: true" to data-bind="popover: initialConstructionGoing"? I'm uncertain whether the "popover" binding or the "if" binding would get evaluated first. – Jason Spake May 16 '17 at 17:23
  • I tried, the popover is still displayed, but once 'initialConstructionGoing' it set to false and the content disappear, the popover is frozen and cannot be dismissed. – Jeremy Dicaire May 16 '17 at 20:52
  • It seems like it's just an order of operations problem. If you can find a way to set the popover binding to false before the initialConstructionGoing gets set to false it should have time to clean up before the element is removed from the DOM. – Jason Spake May 17 '17 at 15:15
  • Thanks Jason, Id didn't think of that. I'll modify my code and post it here once it's working. – Jeremy Dicaire May 17 '17 at 21:25

0 Answers0