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

Slug Links #2878

Closed
mastacontrola opened this issue Mar 18, 2015 · 2 comments
Closed

Slug Links #2878

mastacontrola opened this issue Mar 18, 2015 · 2 comments
Assignees
Milestone

Comments

@mastacontrola
Copy link

Filtering through the issues here is quite difficult, so I'm sorry if this issue has already been reported.

Found an issue in the "post_slug_urls" (for lack of better terminology) in that the URL address changes based on the location of the viewport in the browser.

This causes an issue where if you try to go to forum post #3 using a slug URL it may take you to post #5.

Edited for more accurate description.

Basically the slugs that present at the bottom of a post appear to reference the post below it. However, the link that displays in the drop down appears to reference the proper link.

Hopefully this is definitive enough to find and correct the issue.

@akhoury
Copy link
Member

akhoury commented Mar 18, 2015

+1

a simple example
https://community.nodebb.org/topic/180/who-is-using-nodebb/3

This is scroll to /3 but the url changes to /6. So if I were to share it again, it now scrolls to /6 instead of /3

I think this is happening is because the URL is changing based on the post at the bottom of the viewport where when it auto-scrolls, it sets the target-post to the top of the viewport.

I think the right way to fix this is to behave like the native deep linking behavior of the browser using DOM element IDs, which assume the top of the viewport all the time.

so, for example, in order for the URL to change to /3, the post-n-3 needs to be at the top of the viewport, and when auto-scrolling, the behavior stays the same, the post-n-3 will be at the top of the viewport.

one caveat is that you can never link to the most last post if that post can never hit the top of the viewport. Say post /15. However one should still be able to copy a direct hyperlink with /15 in it, the scroller will do its best to set it at the top of the viewport, if it can't because it hit the limit of the page (and you should not be able to negative-scroll, that's fine this is how the native deep linking works anyways) but the post would still be "highlighted"

@barisusakli
Copy link
Member

To fix this we need to untie the /index in the url and the index in the navigator (x out of postcount) Right now they use the same value AFAIK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants