I would like to use an anchor-element with a hash-URL inside of a custom element that uses shadow DOM. I would expect, that the browser scrolls down to that anchor, but it does not do it (at least Chrome).
Detail:
I have an index.html like this:
...
<a href="#destinationInsideShadowDOM">Jump</a>
...
<my-custom-element></my-custom-element>
...
And another html-file for the custom-element, which contains the anchor:
<template id="my-custom-element">
...
<a id="destinationInsideShadowDOM"></a>
...
</template>
I want the browser to scroll down to that anchor when I click on the link in index.html.
When I move the anchor into index.html, outside of the custom-element, it works, but not inside.
scrollIntoView()
– Thorazine