diff --git a/assets/js/phoenix_live_view/js.js b/assets/js/phoenix_live_view/js.js index 2a7f0dbd98..1445090c02 100644 --- a/assets/js/phoenix_live_view/js.js +++ b/assets/js/phoenix_live_view/js.js @@ -190,11 +190,13 @@ let JS = { if(eventType === "remove"){ return } let onStart = () => { this.addOrRemoveClasses(el, inStartClasses, outClasses.concat(outStartClasses).concat(outEndClasses)) - let stickyDisplay = display || this.defaultDisplay(el) - DOM.putSticky(el, "toggle", currentEl => currentEl.style.display = stickyDisplay) window.requestAnimationFrame(() => { this.addOrRemoveClasses(el, inClasses, []) - window.requestAnimationFrame(() => this.addOrRemoveClasses(el, inEndClasses, inStartClasses)) + window.requestAnimationFrame(() => { + this.addOrRemoveClasses(el, inEndClasses, inStartClasses) + let stickyDisplay = display || this.defaultDisplay(el) + DOM.putSticky(el, "toggle", currentEl => currentEl.style.display = stickyDisplay) + }) }) } let onEnd = () => {