Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
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

Closed

Description

@saurabh-shelgaonkar

Bug, enhancement request, or proposal:

Bug

CodePen and steps to reproduce the issue:

https://codepen.io/saurabh-shelgaonkar/pen/LmqRZz?editors=0010

Detailed Reproduction Steps:

  1. This is a codepen from AngularJs Material Website for Panel animation
  2. Click on Dialog to Open the Dialog, then close the dialog with close button. Here I have used mdPanelRef.hide() to hide the panel.
  3. Open the panel with Show button. It will not appear.
  4. Comment the animation in config. Repeat the above steps, the panel appears.

What is the expected behavior?

The panel should show and hide with animations in config.

What is the current behavior?

The panel doesn't show and hide with animations in config.

What is the use-case or motivation for changing an existing behavior?

It is important to maintain the panel state many a times, so using show and hide.

Which versions of AngularJS, Material, OS, and browsers are affected?

  • AngularJS: 1.6.7
  • AngularJS Material: 1.1.9
  • OS:
  • Browsers: Chrome

Is there anything else we should know? Stack Traces, Screenshots, etc.

No

Activity

  1. codymikol commented on May 21, 2018

    @codymikol
    Contributor

    I got your scenario to work in this pen https://codepen.io/codymikol/pen/XqGrPB?editors=0011

  2. saurabh-shelgaonkar commented on May 21, 2018

    @saurabh-shelgaonkar
    Author

    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.

  3. codymikol commented on May 22, 2018

    @codymikol
    Contributor

    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.

  4. 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
  5. added this to the 1.1.10 milestone on May 23, 2018
  6. added
    needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
    P3: importantImportant issues that really should be fixed when possible.
    on May 23, 2018
  7. modified the milestones: 1.1.10, 1.1.11 on Jun 19, 2018
  8. NgMomentum commented on Sep 2, 2018

    @NgMomentum

    This might be related (or not), but I add this code:

            // Make sure it is an array
    	if (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.

  9. modified the milestones: 1.1.11, 1.1.12 on Sep 10, 2018
  10. Splaktar commented on Sep 17, 2018

    @Splaktar
    Contributor

    @NgMomentum I gave that a shot, but it did not help with fixing this issue unfortunately.

  11. 18 remaining items

  12. Splaktar commented on Feb 14, 2020

    @Splaktar
    Contributor

    It seems like animateOpen and animateClose apply the transitionInClass and transitionOutClass properly when custom open and close animation classes are supplied as documented here.

    animationOptions = {
    transitionInClass: this._animationClass['open'],
    transitionOutClass: this._animationClass['close'],
    };

    That may be a path to quickly verifying if this approach works or not?

  13. Splaktar commented on Feb 14, 2020

    @Splaktar
    Contributor

    Yep, that looks like it works. This CodePen changes JS line 41 to

    .withAnimation({open: '_md-panel-animate-enter', close: '_md-panel-animate-leave'});

    Which causes opening to work repeatedly.

    @oliversalzburg are you interested in sending a PR for this?

  14. oliversalzburg commented on Feb 14, 2020

    @oliversalzburg
    Contributor

    @oliversalzburg are you interested in sending a PR for this?

    Very much so! Thanks for the input. I will give this another close look.

  15. oliversalzburg commented on Feb 14, 2020

    @oliversalzburg
    Contributor

    @Splaktar I submitted #11856, which should fix this issue.

  16. added
    P2: requiredIssues that must be fixed.
    and removed
    P3: importantImportant issues that really should be fixed when possible.
    on Apr 27, 2020
  17. modified the milestones: - Backlog, 1.1.23 on Apr 27, 2020
  18. added a commit that references this issue on Apr 30, 2020
    a3c533f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions