Skip to content

Commit

Permalink
Fix #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.

(cherry picked from commit 1323e9f)
  • Loading branch information
Kenneth G. Franqueiro committed Dec 11, 2015
1 parent 8b969fc commit 44ae739
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,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 44ae739

Please sign in to comment.