-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Multiple popover have all the same scope since beta.14 #3173
Comments
Here's a workaround, it implies creating the popover just in time and removing it when it is hidden: 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. |
+1. Was quite hard to detect what was going on exactly. |
Alejandro http://noanavaro.de/youtube_range 13.03.2015, 02:26, "Alejandro Magnorsky" notifications@github.com:+1. Was quite hard to detect what was going on exactly. —Reply to this email directly or . |
+1, Please look into this. |
I tried again @kristianbenoit solution, but now is not even working in his codepen if we update to ionic.rc.3. |
+1 |
I confirm the workaround I proposed does not work anymore in 1.0.0-rc.3 and nightly. |
+1, Someone know the solution for the bug? |
@YongdeCHEN, so far use my work around with ionic-1.0.0-rc.2 |
@brodykidd, this is the issue I mentioned in the email ;) |
+1 |
could this issue also be related? http://codepen.io/anon/pen/yNPmvL |
@liyo, that's the same problem. Using the solution I provided above should fix your problem (create the popover in the ng-click handler). |
@kristianbenoit, what about version 1.0.0? Your solution doesn't work with the "stable" version, right? |
@kristianbenoit, actually I tried your method with the latest version and it worked! Great, thanks. |
@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 |
@alejandromagnorsky, as @liyo says, there is an issue involving an infinite loop in the previous solution, where we call
Here's a pen with a working solution. |
@liyo, the pen you provided, does not remove the popover (it's leaking DOM elements). Did you forget to click save ? |
@kristianbenoit yes indeed I forgot to save, I have updated it now just for reference. |
This works great. However, the weird thing is that it doesn't appear to work in ionic view, but it works in |
Nevermind. Solution works fine. I realized that my reference to my template was wrong. I named it |
Edit: return $ionicModal.fromTemplateUrl(url, ionic.Utils.extend(POPOVER_OPTIONS, options || {})); So multiple calls to $ionicPopover.fromTemplateUrl overwrites POPOVER_OPTIONS. It works better using something like this: return $ionicModal.fromTemplateUrl(url, ionic.Utils.extend({}, POPOVER_OPTIONS, options)); |
Prevent the popover options to be overwritten (fix #3173)
Type: bug
Platform: all
If there is multiple popover in the same page, for example in a list, they all get the same scope.
The problem is not present when using beta13, but is in beta.14 and rc.0.
Remove one popover and you can't open the other ones ... (reopen the same one)
Here's a pen that show the bug.:
http://codepen.io/kbenoit/pen/OPZoeV
The text was updated successfully, but these errors were encountered: