-
Notifications
You must be signed in to change notification settings - Fork 3k
updating url only without any other actions #3122
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
Comments
Looks like I found the solution after all.. setting dynamic: true on the param seems to work.. |
I spoke to soon... still having this problem.. Note: The issue seems to be that I use "#".. changing to "id" stops the wired issue, testing some more.. Note2: For now I have a hack to get me moving. $location.hash(this.$stateParams.id); it works but the url´s look like crap! ("category/3?id=24-WB06#24-WB06") so it would still be nice to get some ideas on this issue :) |
I'm assuming you're using some sort of scroll spy. The router manages the URL hash as a state parameter. You should be able to update it by changing the parameter $state.go(".", { #: '24-WB06'}, { location: 'replace' }); |
Yes I have a scroll spy (using https://github.com/camwiegert/in-view) thx to your reply I figured out how to get it working better but still not flawless ;) the problem right now is that when I update url it jumps to top if that item creating a sort of page flickering.. but this is just a matter of implementation pattern.. Thx for you help and keep up the awesome work on the module! it´s truly a gem! |
Spoke to soon.. again... so the .go will trigger a transition but I just want to update the location.. how? |
|
And also triggers the view to scroll to the id!(?)
|
@mackelito that's native browser behavior, right? How does other scrollspy implementations update the browser hash without triggering scrolling? |
I guess it should prevent the "bubble" event.. perhaps by using stopPropagation? |
I think that's your homework :) Figure out how other scrollspy implementations do it (then do that). If you find that you can't implement it without some specific support from ui-router, feel free to re-open this issue and we can discuss the ramifications. Otherwise, I'm closing because I think ui-router is doing what it should be doing. |
I have a component with 200+ items and want to update the url to be something like 'category/3#24-MB01' when scrolling.
When a item comes in view I update the url using this code:
Url is updated but the browser navigates to the item with id "#24-MB01"...
Have been searching both StackOverflow and the issues and now I´m kind of lost.. Any guidance is much appreciated!
Note: Using 1.0 beta3
The text was updated successfully, but these errors were encountered: