From 325197175b4f27141338d0589b3d873d87e1e982 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sun, 7 Jul 2024 16:31:34 +0200 Subject: [PATCH] Bugfix: prevent multiple afterShow() and afterHide() due to `transitionend` on multiple properties --- dev/Knoin/Knoin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js index 3838c9b29..0d89d40e9 100644 --- a/dev/Knoin/Knoin.js +++ b/dev/Knoin/Knoin.js @@ -74,8 +74,10 @@ const // vmDom.addEventListener('close', () => vm.modalVisible(false)); // show/hide popup/modal + // transitionend is called for each property, so we only listen to `top` + // as defined in CSS by `dialog:not(.animate)` const endShowHide = e => { - if (e.target === vmDom) { + if (e.target === vmDom && 'top' === e.propertyName) { if (vmDom.classList.contains('animate')) { vm.afterShow?.(); fireEvent('rl-vm-visible', vm);