From acf24fa4eda7af8bd043b556479e7f9736bc7165 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Tue, 17 Dec 2019 14:21:50 +0100 Subject: [PATCH] fix: trigger reflow / layout thrashing - closes #11943 --- js/foundation.util.motion.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/foundation.util.motion.js b/js/foundation.util.motion.js index 07e760cb5..4bd3e1a47 100644 --- a/js/foundation.util.motion.js +++ b/js/foundation.util.motion.js @@ -77,6 +77,10 @@ function animate(isIn, element, animation, cb) { // Start the animation requestAnimationFrame(() => { + // will trigger the browser to synchronously calculate the style and layout + // also called reflow or layout thrashing + // see https://gist.github.com/paulirish/5d52fb081b3570c81e3a + element[0].offsetWidth; element .css('transition', '') .addClass(activeClass); -- 2.47.2