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

Runtime scrollToHash handlers incorrectly capture hash links off root pages (/ -> /checklist/1/#hash) and subpages (/checklist/ -> /checklist/1/#hash #884

Open
1 task done
cbutcosk opened this issue Nov 30, 2023 · 6 comments
Assignees
Labels
status: test needed tested needed to confirm the issue and determine how to proceed

Comments

@cbutcosk
Copy link
Collaborator

Before proceeding, make sure there isn’t an existing issue for this bug.

  • I have searched the existing issues and determined this is a new bug.

Expected Behavior

We added a link from the cover page (url: /) to a hash anchor in an inner page, expecting that when users clicked the link they would be taken to that inner page and scroll to that section (url: /checklist/1/#cool-element).

Actual Behavior

Nothing happens, the user stays on the link.

Steps to Reproduce

Put an unadorned anchor link (ie, no q-modal_link class) anywhere in a quire document or template code.

Version Numbers

quire-cli 1.0.0-rc.11
quire-11ty 1.0.0-rc.16
starter https://github.com/thegetty/[email protected]
[System]
quire-cli 1.0.0-rc.11
node v18.17.0
npm 6.14.18
os Darwin 22.6.0

Web Browser

Safari 17

Relevant Terminal/Shell Output

No response

Supporting Information

No response

@cbutcosk cbutcosk added the status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues. label Nov 30, 2023
@Erin-Cecele
Copy link
Collaborator

Hi @cbutcosk, does this sound similar to an issue I documented and resolved for one of our Getty Quire publications: thegetty/inventories-and-surveys#12? I think this solution is tied specifically to headers, but maybe it provides some helpful insight. If not, I will bring this to the rest of the team for discussion.

@Erin-Cecele
Copy link
Collaborator

Hi @cbutcosk, Upon further review, I realize this is actually a Javascript issue. We often create links to other pages and haven't encountered this issue before. I will test and try to get to the bottom of what's going on.

@Erin-Cecele Erin-Cecele added status: test needed tested needed to confirm the issue and determine how to proceed and removed status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues. labels Dec 6, 2023
@Erin-Cecele
Copy link
Collaborator

Per @geealbers request, @jenpark-getty can you please test this issue following these steps:

  • Create a new starter project
  • In essay.md identify an anchor link you want to use on the lower half of the page (for example [Fig. 4](#fig-4)).
  • Create a link to that figure on the index.md page and intro.md page: [Fig. 4](/essay/#fig-4)
  • Preview the project, click the link on both the cover and the intro and confirm whether it takes you to the figure (i.e. figure 4)

Please try it on a few different browsers and report back. Thank you!

@geealbers
Copy link
Member

@Erin-Cecele, just so you know, @jenpark-getty and I talked about this a bit and I asked her to also test links to and from every possible combination to make sure we had our bases covered:

  • home page to a top-level page and a sub-directory page
  • top-level page to the home page and sub-directory page
  • sub-directory page to the home page and a top-level page

@jenpark-getty
Copy link

jenpark-getty commented Feb 19, 2024

  • Home (index.md) -> top-level (intro.md, essay.md) ❌
  • Home to sub-directory (catalogue/1) ❌
  • Top-level (intro.md, catalogue) to home ✅
  • Top-level (intro.md) to sub-directory (catalogue/2) ✅
  • Top level (catalogue.md) to sub-directory ❌
  • Sub-directory (catalogue/1) to home ✅
  • Sub-directory (catalogue/1) to top-level (catalogue) ✅

Interestingly, opening the ❌ links in a new tab does make it work.

@Erin-Cecele
Copy link
Collaborator

Thank you @jenpark-getty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: test needed tested needed to confirm the issue and determine how to proceed
Projects
None yet
Development

No branches or pull requests

4 participants