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

Clicking on ref link leads to wrong location #27

Open
jstac opened this issue Sep 2, 2020 · 6 comments
Open

Clicking on ref link leads to wrong location #27

jstac opened this issue Sep 2, 2020 · 6 comments

Comments

@jstac
Copy link
Member

jstac commented Sep 2, 2020

Maybe "wrong location" is an exaggeration, but what I mean is that if you click on a link that says "Theorem 1" in Chrome, you are directed to the theorem body, while the header "Theorem 1" is not visible --- it's off the top of the screen.

Hence it's not clear that you have been directed to the right place unless you scroll up.

@najuzilu
Copy link
Member

najuzilu commented Sep 2, 2020

Yes, I have noticed that as well. It's actually because of the main topbar which has a white background and it's almost the same height as the title div of the directive.

@jstac
Copy link
Member Author

jstac commented Sep 2, 2020

Is there any way to fix it you can think of?

@mmcky
Copy link
Member

mmcky commented Sep 4, 2020

@najuzilu would it help to wrap the whole theorem in another div and set the id=target to get link to the top of a theorem? @AakashGfude may be able to help on the html side of things here.

@AakashGfude
Copy link
Member

I think the easiest way might be to control the scroll behaviour using javascript and provide a bit of an offset to the location scrolled.
If @najuzilu is not working on this, I can give this one a shot.

@najuzilu
Copy link
Member

najuzilu commented Sep 4, 2020

I have a working solution for same-file targets, but I need to account for targets leading to different locations. I decided to go with JS and animate the scroll. How does that sound @AakashGfude?

@AakashGfude
Copy link
Member

sounds good @najuzilu . I guess it will be a more generic solution.

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

No branches or pull requests

4 participants