fix: regression where clicking anchors on the same page wouldn't set the anchor in the url
This commit is contained in:
		@@ -15,7 +15,7 @@ const isLocalUrl = (href: string) => {
 | 
				
			|||||||
    if (window.location.origin === url.origin) {
 | 
					    if (window.location.origin === url.origin) {
 | 
				
			||||||
      return true
 | 
					      return true
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  } catch (e) {}
 | 
					  } catch (e) { }
 | 
				
			||||||
  return false
 | 
					  return false
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -109,6 +109,7 @@ function createRouter() {
 | 
				
			|||||||
      if (isSamePage(url) && url.hash) {
 | 
					      if (isSamePage(url) && url.hash) {
 | 
				
			||||||
        const el = document.getElementById(decodeURIComponent(url.hash.substring(1)))
 | 
					        const el = document.getElementById(decodeURIComponent(url.hash.substring(1)))
 | 
				
			||||||
        el?.scrollIntoView()
 | 
					        el?.scrollIntoView()
 | 
				
			||||||
 | 
					        history.pushState({}, "", url)
 | 
				
			||||||
        return
 | 
					        return
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user