From 19e6a2b9a8934c50b61e3fdc3016c6bbf3f49957 Mon Sep 17 00:00:00 2001 From: rasulov1337 <117843890+rasulov1337@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:44:38 +0300 Subject: [PATCH] fix: do not go to ad page on click on kebab --- src/components/AdCard/AdCard.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/AdCard/AdCard.ts b/src/components/AdCard/AdCard.ts index b2929e6..57f9a9d 100644 --- a/src/components/AdCard/AdCard.ts +++ b/src/components/AdCard/AdCard.ts @@ -63,6 +63,10 @@ export default class AdCard extends ReactiveComponent { ) as HTMLButtonElement ).onclick = (e) => this.showOnMap(e); + (this.thisElement.querySelector('.js-kebab') as HTMLElement).onclick = ( + e + ) => e.stopPropagation(); + setTimeout(() => { this.addImageScrolling(); }, 0); // setTimeout ensures the code will be called AFTER browser finished rendering innerHTML new content