Add hash to URL onClick

This commit is contained in:
Fabio Berger
2018-03-02 15:10:44 +01:00
parent 5906f4c995
commit a2b262c9df

View File

@@ -38,7 +38,9 @@ export class MarkdownLinkBlock extends React.Component<MarkdownLinkBlockProps, M
}
}
private _onHashUrlClick(href: string) {
const hashWithPrefix = `#${href.split('#')[1]}`;
const hash = href.split('#')[1];
const hashWithPrefix = `#${hash}`;
utils.scrollToHash(hashWithPrefix, configs.SCROLL_CONTAINER_ID);
utils.setUrlHash(hash);
}
}