Open ionitron-bot[bot] opened 5 years ago
not sure if exactly the same issue, but I was able to remove the delay by disabling the animation on dismiss.
this.viewCtrl.dismiss({data: 'test1'}, null, {animate: false}); // Applies to ionic 3...
@fcarreno any idea on how we could do that same thing from a background dismiss? As far as I know the .present only takes a callback an no other parameters. I tried popover.present({ animate: false }) but I'm still seeing the delay. Tried adding a custom transition for the 'leaveAnimation' as I've done with a modal before, but that is not allowed apparently.
@mateotherock not sure I follow. What do you mean 'from a background dismiss'? If you can share a bit of the sequence of events/code, that'll help...
@fcarreno ah sorry I just mean dismissing the popover by clicking anywhere in the background. In my app I generally like to allow this option for users to quickly back out of the popover without requiring an action within the popover. Your solution to remove the animate when manually dismissing the popover should work I imagine, but I don't think you can include something like that without the dismiss() method being called like in an onDidDismiss() or in the create(). At any rate, what I tried to do here was I found the popoverLeave method in the config of the actual popover and replaced it with a custom animation of my own where I set the animation to be much shorter. You could do this before presenting the popover or in the onWillDismiss method. That is hacky but it seems to work so far.
hummm. Not sure. I don't notice a delay when dismissing it by clicking on the backdrop. I only noticed it when calling dismiss() on the popover instance, so not sure what your problem could be...
Do you have the onWillDismiss() method in ionic V3? I had the same problem in ionic V4 and used the onWillDismiss().
onDidDismiss() is called after the animation ends. onWillDismiss() is called when the dismiss() method is called.
Original issue by @tonyawad88 on 2016-12-19T11:50:25Z
Ionic version: (check one with "x") [x] 2.x
I'm submitting a ... (check one with "x") [x] bug report
Current behavior: The current popover behaviour seems to have a delay from when I click a button inside the popover to when the dismiss event fires back / notifies the parent controller. The delay is about 1-2seconds, which is noticeable.
Note: I haven't used Popover in previous Ionic RCs so I am not sure if this is new or it existing behaviour
Expected behavior: Reduce delay from when the popover dismissal occurs to when the parent controller receives the event.
Steps to reproduce: I tried creating a plunker but it is using RC2. There seems to be a bug in rc2 for this. But I added my code to the plunker. It's pretty basic.
http://plnkr.co/edit/NOwo7GJBVgZl6qe0CfHf?p=info
Other information: N/A
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):