Skip to content

Clicking on ref link leads to wrong location #27

Open

Description

@jstac

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.

Activity

  1. najuzilu commented on Sep 2, 2020

    @najuzilu
    Member

    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.

  2. jstac commented on Sep 2, 2020

    @jstac
    MemberAuthor

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

  3. mmcky commented on Sep 4, 2020

    @mmcky
    Member

    @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.

  4. AakashGfude commented on Sep 4, 2020

    @AakashGfude
    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.

  5. najuzilu commented on Sep 4, 2020

    @najuzilu
    Member

    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?

  6. AakashGfude commented on Sep 5, 2020

    @AakashGfude
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions