Skip to content

Commit

Permalink
Fix SitePen#1069: Tree: Continue to listen for transitionend events
Browse files Browse the repository at this point in the history
The container only gets created once, so we need to listen for more than the
first transitionend event, in order to remove the fixed height which could
interfere with inner parent expansion.

Additionally, the immediate call to `_onTreeTransitionEnd` is unnecessary,
since the no-transition path skips height adjustment and already handles
updating the display property elsewhere.

Thanks @jbomer, @bogool, and @kriszyp for poking at this and helping to
arrive at the solution.
  • Loading branch information
Kenneth G. Franqueiro committed Dec 11, 2015
1 parent 32e135c commit 1323e9f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Tree.js
Expand Up @@ -141,11 +141,10 @@ define([
});
}

if (hasTransitionend && !noTransition) {
on.once(container, hasTransitionend, this._onTreeTransitionEnd);
}
else {
this._onTreeTransitionEnd.call(container);
if (hasTransitionend) {
// Update height whenever a collapse/expand transition ends.
// (This handler is only registered when each child container is first created.)
on(container, hasTransitionend, this._onTreeTransitionEnd);
}
}

Expand Down

0 comments on commit 1323e9f

Please sign in to comment.