From 9c8d144cf942aba512c3c44fa328ff90414af91f Mon Sep 17 00:00:00 2001 From: Perry Govier Date: Fri, 28 Jan 2022 20:37:58 -0600 Subject: [PATCH] Fix for possible race condition in Chrome --- src/jquery.mixitup.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/jquery.mixitup.js b/src/jquery.mixitup.js index b23a602..b0c8fe2 100644 --- a/src/jquery.mixitup.js +++ b/src/jquery.mixitup.js @@ -1243,7 +1243,7 @@ } for(var i = 0; i < self._$toShow.length; i++){ - var el = self._$toShow[i], + const el = self._$toShow[i], $el = $(el), translate = { x: el.dataset.finalPosX - el.dataset.interPosX, @@ -1273,7 +1273,7 @@ (self._ff && self._ff <= 20) ? $el.css(toShowCSS) : - $el.css(self.effects.transition).css(toShowCSS); + requestAnimationFrame(()=>$el.css(self.effects.transition).css(toShowCSS)); } for(var i = 0; i < self._$pre.length; i++){ @@ -2095,4 +2095,4 @@ }); }; -})(jQuery); \ No newline at end of file +})(jQuery);