You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: routing integrations don't support hash links #19365
Thanks for the issue! It looks like this is still an issue in Ionic 6. I spun up an Angular test app with the following HTML inside an ion-content:
<pid="testPara">test</p><p>test</p><p>test</p><!-- more paras here --><ion-button[routerLink]="['/home']" fragment="testPara">Anchor Link</ion-button>
Clicking the button correctly changed my URL to /home#testPara, but the content didn't scroll. The behavior was the same whether I had the router config set up as described or not. I was also able to replicate this behavior in React and Vue using routerLink="#testPara".
We'll likely need to update the routing integrations for each framework to detect a hash in the URL and call a scroll method on ion-content as needed.
In the meantime, a possible workaround would be to use the scrollToPoint method on ion-content to manually scroll to the element with the chosen ID.
changed the title [-]bug: Support for Angular's 'anchorScrolling' router option[/-][+]bug: routing integrations don't support hash links[/+]on Feb 7, 2022
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
averyrousseau commentedon Feb 7, 2022
Thanks for the issue! It looks like this is still an issue in Ionic 6. I spun up an Angular test app with the following HTML inside an
ion-content:Clicking the button correctly changed my URL to
/home#testPara, but the content didn't scroll. The behavior was the same whether I had the router config set up as described or not. I was also able to replicate this behavior in React and Vue usingrouterLink="#testPara".We'll likely need to update the routing integrations for each framework to detect a hash in the URL and call a scroll method on
ion-contentas needed.In the meantime, a possible workaround would be to use the
scrollToPointmethod onion-contentto manually scroll to the element with the chosen ID.[-]bug: Support for Angular's 'anchorScrolling' router option[/-][+]bug: routing integrations don't support hash links[/+]joelmeaders commentedon Dec 13, 2023
Just ran into this. Anyone find any good fixes?
fix(router): support anchor fragments in href (ionic-team#31172)
ShaneK commentedon Jun 3, 2026
Hey! The fix for this has been released as part of v8.8.9. Thanks for the report!
ionitron-bot commentedon Jul 3, 2026
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
fix(router): support anchor fragments in href (ionic-team#31172)