Fix non-woking fragment on long page load

This commit is contained in:
schmelczerandras 2020-11-26 22:55:02 +01:00
parent 84c6c9e37c
commit c819b3f409

View file

@ -24,7 +24,16 @@ const removeUnnecessaryOutlines = () =>
(document.activeElement as HTMLElement).blur?.()
);
// it might be necessary when the page takes too long to load
const scrollToFragment = () => {
if (location.hash) {
document.getElementById(location.hash.slice(1))?.scrollIntoView();
}
};
addSupportForTabNavigation();
removeUnnecessaryOutlines();
create();
scrollToFragment();