ember-animation / liquid-fire

Animations & transitions for ambitious Ember applications.
Other
1.15k stars 199 forks source link

Transition with root route doesn't seem to work #542

Open benbabics opened 7 years ago

benbabics commented 7 years ago

I'm having trouble getting an initial transition to work with my root route (login).

router.js

Router.map(function() {
  this.route('login', { path: '' });
});

transitions.js

this.transition(
    this.fromRoute( null ),
    this.toRoute( 'login' ),
    this.use( 'fade' )
  );

Results in no visible transition, and the following output:

[liquid-fire] Checking transition rules for <div id=​"ember402" class=​"ember-view liquid-container">​…​</div>​
constraints.js:167 [liquid-fire rule 0] rejected because firstTime was yes

Fair enough, I stumbled on onInitialRender in the docs. However, when I try it with onInitialRender, using the following: transitions.js

this.transition(
    this.onInitialRender(),
    this.toRoute( 'login' ),
    this.use( 'fade' )
  );

Results in no visible transition, and the following output:

[liquid-fire] Checking transition rules for <div id=​"ember402" class=​"ember-view liquid-container liquid-animating" style=​"width:​ 1440px;​ height:​ 99px;​">​…​</div>​
constraints.js:114 [liquid-fire rule 0] matched

Is this a bug, or am I doing it wrong? Any help is much appreciated.

weedgrease commented 7 years ago

Trying to do the same thing here. I was using this.fromRoute(). Same result.