Skip to content
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

animationConfig does not work on neon-animation-pages #209

Open
HW-Siew opened this issue Oct 19, 2016 · 6 comments
Open

animationConfig does not work on neon-animation-pages #209

HW-Siew opened this issue Oct 19, 2016 · 6 comments

Comments

@HW-Siew
Copy link

HW-Siew commented Oct 19, 2016

Hi, I am trying to change the duration of animation for neon-animation-pages as follow.

<neon-animated-pages id="pages" selected="[[selected]]" animation-config="[[animationConfig]]">
...
</neon-animated-pages>

Polymer({
  is : 'custom-view',
  properties:{
    animationConfig:{
      value : function(){
           return {
              entry:{
              name:'slide-from-right-animation',
          node:this.$.pages,
          timing: {duration: 5000}
           },
          exit: {
         name: 'slide-left-animation',
              node: this.$.pages,
         timing: {duration: 5000}
          }
           }
      }
    }
  },
  ....
})

However, it doesnt work. Not only the duration is not applied and also the animation 'slid-from-right-animation' and 'slide-left-animation'.

Any idea what am i missing?

Thanks for advise.

@vguillou
Copy link
Contributor

Quick question here :
Did you import the slide-from-right-animation and slide-left-animation ?

@HW-Siew
Copy link
Author

HW-Siew commented Oct 20, 2016

Hi @vguillou, yes i did. It was working when i use 'entry-animation' and 'exit-animation' instead of 'animation-config'.

@araker
Copy link

araker commented Mar 2, 2017

I'm having the same problem, from what I see in the source the animationConfig object gets cleared out when switching to another page. See https://github.com/PolymerElements/neon-animation/blob/master/neon-animated-pages.html on line 107.

@dannywolfmx
Copy link

Same problem here

@mgiuffrida
Copy link
Contributor

@araker is exactly right. neon-animated-pages has an animationConfig property (from NeonAnimatableBehavior), but overwrites it with an empty array in _onIronSelect().

I think this is WAI, in the sense that entry and exit on neon-animated-pages are convenience properties; if you want to use specific animation config objects, you have to set those on each child/subpage. But that's a pain, and given that animationConfig is documented, it seems reasonable to check if it's been set (or if entryAnimation and exitAnimation are both empty) instead of always overwriting it.

scheib pushed a commit to scheib/chromium that referenced this issue May 5, 2017
Expanding or collapsing a section takes 350ms, but fading the new content
in and the old content out takes 500ms. This is a contributing factor to
the overlap seen when closing a section, as the old section is still
visible when the collapse animation has completed.

Shortening the fade duration to match the expand/collapse animation makes
that overlap much less likely to occur. It also makes the animations
appear snappier, IMO -- if the page is still fading after expanding, it
looks slugging.

This re-implements the fade animations, rather than programmatically
changing the neon-animated-pages' transition durations for the
existing fade-in-animation/fade-out-animation. The latter is not possible
due to PolymerElements/neon-animation#209.

[email protected]
BUG=716680
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2856223007
Cr-Commit-Position: refs/heads/master@{#469582}
rogerwang pushed a commit to nwjs/chromium.src that referenced this issue May 17, 2017
Expanding or collapsing a section takes 350ms, but fading the new content
in and the old content out takes 500ms. This is a contributing factor to
the overlap seen when closing a section, as the old section is still
visible when the collapse animation has completed.

Shortening the fade duration to match the expand/collapse animation makes
that overlap much less likely to occur. It also makes the animations
appear snappier, IMO -- if the page is still fading after expanding, it
looks slugging.

This re-implements the fade animations, rather than programmatically
changing the neon-animated-pages' transition durations for the
existing fade-in-animation/fade-out-animation. The latter is not possible
due to PolymerElements/neon-animation#209.

[email protected]
BUG=716680
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2856223007
Cr-Original-Commit-Position: refs/heads/master@{#469582}
Review-Url: https://codereview.chromium.org/2889653005 .
Cr-Commit-Position: refs/branch-heads/3071@{#590}
Cr-Branched-From: a106f0a-refs/heads/master@{#464641}
@dman777
Copy link

dman777 commented Oct 21, 2018

@mgiuffrida like this? I tried it but the effect doesn't seem to take effect

In Polymer 1....

    <neon-animated-pages
      animation-config="[[animationConfig]]"
      selected="{{parent}}"
      id="foo">
 
      <module-settings slot="other" id="bob" name="module-settings" provider="[[provider]]"></module-settings>

--------------------------------
          animationConfig: {
            value: function() {
              return {
                'entry': [
                  {name: 'slide-from-right-animation' },
                  {animatable: this.$.bob, type: 'entry'}
                ]
              }
            }
          },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants