From 05614eda610d94377b63cfda46e923c19e1e72e9 Mon Sep 17 00:00:00 2001 From: Furkan Cabbar <34713212+ffcabbar@users.noreply.github.com> Date: Tue, 12 Nov 2024 11:35:54 +0300 Subject: [PATCH] fix: closing bottomsheet multiple hook triggering [MDS-1369] (#856) --- assets/js/hooks/bottom_sheet.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/js/hooks/bottom_sheet.js b/assets/js/hooks/bottom_sheet.js index c657728d7..a658983dd 100644 --- a/assets/js/hooks/bottom_sheet.js +++ b/assets/js/hooks/bottom_sheet.js @@ -41,7 +41,7 @@ export default { }, setupSwipePanel() { - + if (this.swipePanelInitialized) return; const startPosition = { x: 0, y: 0 @@ -51,7 +51,7 @@ export default { addEvent(document.body, "touchstart", event => { const touch = event.targetTouches[0]; - if ((this.el.dataset.is_open !== undefined)) { + if (this.el.dataset.is_open !== undefined) { startPosition.x = touch.pageX; startPosition.y = touch.pageY; panelHeight = this.panel.offsetHeight; @@ -88,5 +88,6 @@ export default { startedSwipe = false; } }); - }, + this.swipePanelInitialized = true; + } }; \ No newline at end of file