Scroll to element in mat-dialog using fragment link

192 Views Asked by At

I'm implementing a list of posts in a dialog, where a post can quote another post. I would like to be able to scroll to the quoted post when clicking a link which looks like this:

<a href="/thread/123#123">123</a>

However, when I click the link, it closes the dialog instead of scrolling to the correct post.

I already have

scrollPositionRestoration:'enabled', anchorScrolling: 'enabled'

in my route options.

How can I keep the dialog open and scroll to the selected post?

0

There are 0 best solutions below