Skip to content
This repository has been archived by the owner on Jul 29, 2019. It is now read-only.

Timeline synchronous load in 4.17.0 #2307

Closed
pnande opened this issue Nov 12, 2016 · 2 comments
Closed

Timeline synchronous load in 4.17.0 #2307

pnande opened this issue Nov 12, 2016 · 2 comments
Assignees

Comments

@pnande
Copy link

pnande commented Nov 12, 2016

Hi,

In version 4.12.0 I was able to successfully use setWindow() and focus() immediately after creating a Timeline and setting its data, i.e. the view would land wherever those functions were told to go, without having to care for whether the timeline had finished initializing or not.

In version 4.17.0, however, calling setWindow() or focus() right after initializing the timeline will not work. The view will stay somewhere off the target. I suspect this happens because the timeline hasn't finished initialization before the functions are called.

As a workaround I am subscribing to the 'changed' event and then calling the functions inside. I then unsubscribe to the event. However, as much as this is an effective solution to achieving the initial goal, there seems to be a delay between the timeline is first shown and the 'changed' event is called, so what happens is that for a brief second the timeline shows up only to suddenly move to wherever setWindow() or focus() point it to. I managed to also workaround this by hiding the timeline and showing it inside the 'changed' event callback.

I'm not using animation.

Now, I've successfully mitigated the issue, but the solution seems a bit clunky to me coming from 4.12.0 where it just worked without subscribing to events and hiding the timeline before it was ready to show.

Was this a regression or is it the official way of doing things? Is there a better way to use setWindow() or focus() right after the timeline is created?

Thanks.

@mojoaxel
Copy link
Member

mojoaxel commented Nov 13, 2016

I can confirm this is a bug 😢
http://jsbin.com/vihijid/3/edit?js,output

@mojoaxel mojoaxel added this to the Minor Release v4.18 milestone Nov 17, 2016
@yotamberk yotamberk self-assigned this Nov 28, 2016
@yotamberk
Copy link
Contributor

yotamberk commented Nov 28, 2016

Further investigation shows that this bug was introduced between 0.16.1 and 0.17.0.
I'm working on solving the problem.

EDIT:

the problem is here: ff3948f#diff-3deb3f32958bb937ae05c6f3e4abbdf5L715

working to solve this

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

No branches or pull requests

3 participants