Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirects on local anchor reference #959

Closed
cascesme opened this issue Jan 27, 2022 · 2 comments
Closed

Redirects on local anchor reference #959

cascesme opened this issue Jan 27, 2022 · 2 comments
Labels

Comments

@cascesme
Copy link

cascesme commented Jan 27, 2022

I have defined a fallback route for ui-router to use when it cannot identify the route the user is trying to access, using the otherwise param:

@NgModule({
    imports: [
        UIRouterModule.forRoot({ states, useHash: true, otherwise: '/', config: routerConfigFn }),

Using angular 10 with ui-router 8.0.1 with this html:

<a href="#id1">link</a>
.....
<div id="id1">...</div>

Actual:

When I click the link ui-router identifies the route as not recognized and enters the fallback. The result will be the fallback page in this case the '/' root. I cannot remove this otherwise because I need it for other cases.

Expected

UI-Router should ignore this route, and scroll down to the anchor.

Solutions I've tried

Adding a target to self in the <a> element like so:

<a href="#id1" target="_self">Link</a>

But it didn't change anything. I appreciate your help.

@cascesme
Copy link
Author

@stale
Copy link

stale bot commented Aug 12, 2022

This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs.

This does not mean that the issue is invalid. Valid issues
may be reopened.

Thank you for your contributions.

@stale stale bot added the stale label Aug 12, 2022
@stale stale bot closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant