Skip to content

Commit

Permalink
fix: fixed Sample sync map with list
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelsimon committed Apr 2, 2024
1 parent 9c14764 commit 44e2287
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions samples/stores-list-sync-map/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function selectStoreOnList(storeId?: string) {
Array.from(storeList.children).forEach((child) =>
child.classList.remove("active"),
);
storeElement.scrollIntoView();
storeElement.scrollIntoView({ block: "nearest" });
storeElement.classList.add("active");
}
} else {
Expand Down Expand Up @@ -253,13 +253,9 @@ function initMap() {
selectStoreOnList(store.properties.store_id);
},
);
window.woosmap.map.event.addListener(
map,
"store_unselected",
(store: woosmap.map.stores.StoreResponse) => {
selectStoreOnList();
},
);
window.woosmap.map.event.addListener(map, "store_unselected", () => {
selectStoreOnList();
});

storesService = new woosmap.map.StoresService();
localitiesService = new woosmap.map.LocalitiesService();
Expand Down

0 comments on commit 44e2287

Please sign in to comment.