1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

fix: fixes route update with hash

This commit is contained in:
Amir Raminfar
2023-06-18 13:35:04 -07:00
parent b3357e9843
commit e59f9106cc

View File

@@ -58,7 +58,9 @@ const routeHash = useRouteHash();
watch(
routeHash,
(hash) => {
document.querySelector(`[data-key="${hash.substring(1)}"]`)?.scrollIntoView({ block: "center" });
if(hash){
document.querySelector(`[data-key="${hash.substring(1)}"]`)?.scrollIntoView({ block: "center" });
}
},
{ immediate: true, flush: "post" }
);