Fix scrolling for anchors on the current page
Signed-off-by: drankou <aliaksandr.drankou@productboard.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs': patch
|
||||
---
|
||||
|
||||
Fixed a bug where scrolling for anchors where the id starts with number didn't work for the current page.
|
||||
@@ -184,7 +184,7 @@ export const useTechDocsReaderDom = (
|
||||
navigate(`${parsedUrl.pathname}${parsedUrl.hash}`);
|
||||
// Scroll to hash if it's on the current page
|
||||
transformedElement
|
||||
?.querySelector(`#${parsedUrl.hash.slice(1)}`)
|
||||
?.querySelector(`[id="${parsedUrl.hash.slice(1)}"]`)
|
||||
?.scrollIntoView();
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user