You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: Multiple popover have all the same scope since beta.14 #3173
The problem is that popover act as a singleton, all popover have reference to the last one created. That's why instantiating the popover just in time works.
changed the title [-]bug: Multiple popover have all the same scope in beta14[/-][+]bug: Multiple popover have all the same scope since beta.14[/+]on Mar 13, 2015
I tried again @kristianbenoit solution, but now is not even working in his codepen if we update to ionic.rc.3.
Please, this was working before until beta.14 was released...
@alejandromagnorsky, as @liyo says, there is an issue involving an infinite loop in the previous solution, where we call popover.remove while on "popover.hidden", at this point the popover is not hidden yet so on "popover.hidden" is called again. Solution, call stopListening() before popover.remove.
@kristianbenoit yes indeed I forgot to save, I have updated it now just for reference.
Anyway, your new solution works great and there is no need to do a manual DOM removal of popover elements. Thank you!
This works great. However, the weird thing is that it doesn't appear to work in ionic view, but it works in ionic serve, the emulator, and when I deployed it natively to my iOS device.
Nevermind. Solution works fine. I realized that my reference to my template was wrong. I named it popOver.html and didn't realize that my URL was pointing to popover.html... 😢
Activity
kristianbenoit commentedon Feb 24, 2015
Here's a workaround, it implies creating the popover just in time and removing it when it is hidden:
http://codepen.io/kbenoit/pen/emrPdr
The problem is that popover act as a singleton, all popover have reference to the last one created. That's why instantiating the popover just in time works.
alejandromagnorsky commentedon Mar 12, 2015
+1. Was quite hard to detect what was going on exactly.
[-]bug: Multiple popover have all the same scope in beta14[/-][+]bug: Multiple popover have all the same scope since beta.14[/+]Fayozjon commentedon Mar 25, 2015
Alejandro
http://noanavaro.de/youtube_range
13.03.2015, 02:26, "Alejandro Magnorsky" [email protected]:+1. Was quite hard to detect what was going on exactly.
—Reply to this email directly or .
sirhoe commentedon Apr 8, 2015
+1, Please look into this.
alejandromagnorsky commentedon Apr 17, 2015
I tried again @kristianbenoit solution, but now is not even working in his codepen if we update to ionic.rc.3.
Please, this was working before until beta.14 was released...
nutboltu commentedon Apr 20, 2015
+1
kristianbenoit commentedon Apr 22, 2015
I confirm the workaround I proposed does not work anymore in 1.0.0-rc.3 and nightly.
YongdeCHEN commentedon Apr 28, 2015
+1, Someone know the solution for the bug?
kristianbenoit commentedon Apr 28, 2015
@YongdeCHEN, so far use my work around with ionic-1.0.0-rc.2
alejandromagnorsky commentedon May 20, 2015
@brodykidd, this is the issue I mentioned in the email ;)
Just in case you need to update the status.
liyo commentedon Jun 26, 2015
could this issue also be related? http://codepen.io/anon/pen/yNPmvL
kristianbenoit commentedon Jun 26, 2015
@liyo, that's the same problem. Using the solution I provided above should fix your problem (create the popover in the ng-click handler).
alejandromagnorsky commentedon Jun 29, 2015
@kristianbenoit, what about version 1.0.0? Your solution doesn't work with the "stable" version, right?
Thanks anyway.
alejandromagnorsky commentedon Jun 30, 2015
@kristianbenoit, actually I tried your method with the latest version and it worked! Great, thanks.
liyo commentedon Jun 30, 2015
@kristianbenoit thank you, I was able to make it work with the latest Ionic version and your method. To avoid an infinite loop when popovers were removed on hide (because for some reason popover.hidden is still firing on remove), I had to manually remove the popover backdrop DOM elements manually, see: http://codepen.io/liyo/pen/XbZreg
kristianbenoit commentedon Jul 13, 2015
@alejandromagnorsky, as @liyo says, there is an issue involving an infinite loop in the previous solution, where we call
popover.removewhile on"popover.hidden", at this point the popover is not hidden yet so on"popover.hidden"is called again. Solution, callstopListening()beforepopover.remove.Here's a pen with a working solution.
http://codepen.io/kbenoit/pen/BNVomX
kristianbenoit commentedon Jul 13, 2015
@liyo, the pen you provided, does not remove the popover (it's leaking DOM elements). Did you forget to click save ?
liyo commentedon Jul 13, 2015
@kristianbenoit yes indeed I forgot to save, I have updated it now just for reference.
Anyway, your new solution works great and there is no need to do a manual DOM removal of popover elements. Thank you!
digitaluprising commentedon Sep 18, 2015
This works great. However, the weird thing is that it doesn't appear to work in ionic view, but it works in
ionic serve, the emulator, and when I deployed it natively to my iOS device.digitaluprising commentedon Sep 18, 2015
Nevermind. Solution works fine. I realized that my reference to my template was wrong. I named it
popOver.htmland didn't realize that my URL was pointing topopover.html... 😢shaoner commentedon Nov 11, 2015
Edit:
I've just had the same issue.
It seems to be related on how the options are handled in $ionicPopover.fromTemplateUrl.
So multiple calls to $ionicPopover.fromTemplateUrl overwrites POPOVER_OPTIONS.
It works better using something like this:
Merge pull request #4622 from ewdl/fix-popover-override