From 0bac38587616ee8ea27db0a0da491c7fda7e7a17 Mon Sep 17 00:00:00 2001 From: Marie Birner Date: Sat, 8 Apr 2023 07:35:49 +0200 Subject: [PATCH] [BUGFIX] scroll issue sidebar after init --- frontend/main.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/main.ts b/frontend/main.ts index b08912a..5714528 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -103,7 +103,8 @@ function initSidebar() { if(triggerElement.dataset.trigger) { const sidebar = new Sidebar(triggerElement.dataset.trigger); - triggerElement.addEventListener('click', () => { + triggerElement.addEventListener('click', (e) => { + e.preventDefault(); if(triggerElement.dataset.trigger === 'addTrip') { initTripSidebar(triggerElement); }