Use setTimeout instead of transitionend for cleanup #395

Open
wants to merge 3 commits into
from

Projects

None yet

3 participants

@keanulee
Member

(since transitionend won't fire with display: none)

@keanulee keanulee Use setTimeout instead of transitionend for cleanup (since transition…
…end won't fire with display: none)
31ac7f0
@keanulee keanulee requested a review from frankiefu Dec 21, 2016
@googlebot googlebot added the cla: yes label Dec 21, 2016
app-drawer/app-drawer.html
+
+ // Use setTimeout instead of transitionend since transitionend won't fire when app-drawer
+ // is display: none.
+ window.setTimeout(this._resetDrawerState.bind(this), this.transitionDuration);
@blasten
blasten Jan 5, 2017 Member

Consider using debounce('animation', fn, waitTime) here. That way, you are safe that only one timer will fire. You can also use Polymer.dom.flush() in the tests to avoid those nested timeOuts. It might also be posible to remove the condition in line 642.

@keanulee
keanulee Jan 9, 2017 Member

I updated this branch to use debounce instead of setTimeout. Don't think I can use Polymer.dom.flush() in the tests though, since those are the places where I'm waiting for the debouncers to be called.

keanulee added some commits Jan 9, 2017
@keanulee keanulee Use debounce instead of setTimeout
a2e90eb
@keanulee keanulee Fix app-drawer tests
495b39f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment