Fix non-woking fragment on long page load
This commit is contained in:
parent
84c6c9e37c
commit
c819b3f409
1 changed files with 9 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue