ember-page-title
ember-page-title copied to clipboard
liquid-fire transitions
Let's say I have two pages, one with the title foo
and one with the title bar
and I'm using liquid-fire for outlet animations.
If i transition from foo
to bar
while the animation is occuring the page title is updated to bar | foo
once complete the title is updated to bar
.
That is not the behaviour I'd expect, I'd expect either an instant switch to bar
or leave it as foo
until the transition completes and then switch to bar
.
@ef4 have any ideas how to do this?
Both copies of the page-title
helper will necessarily still be on the page during the animation. And it looks like the title concatenation is driven purely by timing. Those two things explain the behavior. I see two possible solutions.
-
The more robust solution would be to make the title concatenation aware of the actual route structure. Since
bar
is not the child offoo
it would never be correct to append them --bar
should just overwrite. -
The less robust solution would be to detect the presence of liquid-fire and use the
waitUntilIdle
method on theliquid-fire-transitions
service to try to correct the timing.
Today I'm not aware of public API for doing solution number 1. The router service RFC (which is beginning to land behind a feature flag now on canary) includes a get-outlet-state
template keyword that would solve the problem.
You could do solution 2 now without much trouble, but I do think it's less robust, since there may be any number of other things that could alter an app's timing.
Thanks @ef4, I think the way forward is to do the second solution as a stop-gap until the first solution is available through Ember's features
@tim-evans Hi Tim, has there been any progress on this?
I haven't done this yet, mostly since the router api has been quite stagnant.
This is still an issue.
However liquid-fire does not seem to be actively developed. Last activity on master branch is from year ago. Not sure how much traction this needs, given that last update on issue was more than 3 years go.
Nevertheless option 2 mentioned 🔝 would work but is a leak of concerns.
Router service related additional template helpers etc. from original RFC https://github.com/emberjs/rfcs/blob/master/text/0095-router-service.md - are not available as well for option 1.
I am proposing an option for addons to be able signal when title should be updated, via registration. Similar to https://github.com/emberjs/ember-test-waiters - possibly more lightweight but idea is the same. This is not perfect but less linked to all possible conflicting addons compared to option 2.