From afb5b2be00c280bcc9a3a3e26770fa12b60eb437 Mon Sep 17 00:00:00 2001 From: Muzaffer Dede Date: Thu, 4 Jun 2020 04:31:47 +0800 Subject: [PATCH] prevented unexpected transitions --- dist/alpine-ie11.js | 4 +++- dist/alpine.js | 4 +++- src/directives/show.js | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/dist/alpine-ie11.js b/dist/alpine-ie11.js index c2a6a41e2..45713e4a9 100644 --- a/dist/alpine-ie11.js +++ b/dist/alpine-ie11.js @@ -6202,6 +6202,8 @@ if (initialUpdate) { + // Asign current value to el to check later on for preventing transition overlaps + el.__x_transition_last_value = value; return value ? showElement(el) : hideElement(el); } @@ -6237,7 +6239,7 @@ _newArrowCheck(this, _this2); }.bind(this)); } - } // Asign current value to el to check later on for preventing transition overlaps + } // Asign current value to el el.__x_transition_last_value = value; diff --git a/dist/alpine.js b/dist/alpine.js index 5c1a92756..a6fa7085b 100644 --- a/dist/alpine.js +++ b/dist/alpine.js @@ -642,6 +642,8 @@ if (initialUpdate) { + // Asign current value to el to check later on for preventing transition overlaps + el.__x_transition_last_value = value; return value ? showElement(el) : hideElement(el); } @@ -661,7 +663,7 @@ } else { resolve(() => {}); } - } // Asign current value to el to check later on for preventing transition overlaps + } // Asign current value to el el.__x_transition_last_value = value; diff --git a/src/directives/show.js b/src/directives/show.js index 025cac26f..c1bcf006d 100644 --- a/src/directives/show.js +++ b/src/directives/show.js @@ -9,6 +9,8 @@ export function handleShowDirective(component, el, value, modifiers, initialUpda // Resolve immediately if initial page load if (initialUpdate) { + // Asign current value to el to check later on for preventing transition overlaps + el.__x_transition_last_value = value return value ? showElement(el) : hideElement(el) } @@ -29,8 +31,7 @@ export function handleShowDirective(component, el, value, modifiers, initialUpda resolve(() => {}) } } - - // Asign current value to el to check later on for preventing transition overlaps + // Asign current value to el el.__x_transition_last_value = value }