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 }}
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
panel: mdPanelRef.show() does not support re-opening a dialog w/ an animation #11291
Hey, you're absolutely right, I set the whole thing up so I could open the panel reference and then went ahead and made a new panel (Not enough coffee yesterday). I updated my pen so it actually calls the reference panel. I am having the same errors as you.
It looks like the return animation on the panel gets mangled somehow. If you try to reproduce this selecting the slide animation type the panel does return, but way off to the left.
EDIT: It looks like the animation is going in to where the previous out animation was. You can see that I'm working on making the pen as simple as possible now to help narrow down what the issue is.
changed the title [-]mdPanel not working with mdPanelRef.hide() and mdPanelRef.show() when animation is applied in config[/-][+]panel: not working with mdPanelRef.hide() and mdPanelRef.show() when animation is applied in config[/+]on May 23, 2018
This might be related (or not), but I add this code:
// Make sure it is an arrayif(angular.isString(self.config.groupName)){self.config.groupName=[self.config.groupName];}
...to the MdPanelRef.prototype.open function in "material.component.panel" to catch input for config.groupName which is a string, and not an array. It appears that using the MdPanelRef.prototype.open function misses the similar validation used in MdPanelService.prototype.create which catches and forces config.groupName to be an array for later processing.
It seems like animateOpen and animateClose apply the transitionInClass and transitionOutClass properly when custom open and close animation classes are supplied as documented here.
Activity
codymikol commentedon May 21, 2018
I got your scenario to work in this pen https://codepen.io/codymikol/pen/XqGrPB?editors=0011
saurabh-shelgaonkar commentedon May 21, 2018
Hey,
Thanks for the reply.
I went through the codepen.
If I am not mistaken, you have opened a new dialog/panel on Show button click.
In my scenario, I want to maintain the state of previously opened dialog, by hiding it, and showing it again via mdPanelRef.
Please verify.
codymikol commentedon May 22, 2018
Hey, you're absolutely right, I set the whole thing up so I could open the panel reference and then went ahead and made a new panel (Not enough coffee yesterday). I updated my pen so it actually calls the reference panel. I am having the same errors as you.
https://codepen.io/codymikol/pen/XqGrPB?editors=1111
It looks like the return animation on the panel gets mangled somehow. If you try to reproduce this selecting the slide animation type the panel does return, but way off to the left.
EDIT: It looks like the animation is going in to where the previous out animation was. You can see that I'm working on making the pen as simple as possible now to help narrow down what the issue is.
[-]mdPanel not working with mdPanelRef.hide() and mdPanelRef.show() when animation is applied in config[/-][+]panel: not working with mdPanelRef.hide() and mdPanelRef.show() when animation is applied in config[/+]NgMomentum commentedon Sep 2, 2018
This might be related (or not), but I add this code:
...to the
MdPanelRef.prototype.openfunction in "material.component.panel" to catch input forconfig.groupNamewhich is a string, and not an array. It appears that using theMdPanelRef.prototype.openfunction misses the similar validation used inMdPanelService.prototype.createwhich catches and forcesconfig.groupNameto be an array for later processing.Splaktar commentedon Sep 17, 2018
@NgMomentum I gave that a shot, but it did not help with fixing this issue unfortunately.
18 remaining items
Splaktar commentedon Feb 14, 2020
It seems like
animateOpenandanimateCloseapply thetransitionInClassandtransitionOutClassproperly when customopenandcloseanimation classes are supplied as documented here.material/src/components/panel/panel.js
Lines 3389 to 3392 in 0b83a2c
That may be a path to quickly verifying if this approach works or not?
Splaktar commentedon Feb 14, 2020
Yep, that looks like it works. This CodePen changes JS line 41 to
Which causes opening to work repeatedly.
@oliversalzburg are you interested in sending a PR for this?
oliversalzburg commentedon Feb 14, 2020
Very much so! Thanks for the input. I will give this another close look.
oliversalzburg commentedon Feb 14, 2020
@Splaktar I submitted #11856, which should fix this issue.
fix(panel): invisble after hide/show cycle