Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Fix lack of anchor support #73

Merged
merged 4 commits into from
Sep 25, 2020
Merged

Fix lack of anchor support #73

merged 4 commits into from
Sep 25, 2020

Conversation

patch0
Copy link
Contributor

@patch0 patch0 commented Sep 25, 2020

At the moment, anchors do not work in chrome/safari. e.g. https://coderdojo.com/ways-to-run/#online does not scroll the page down to the Online section, despite the div having the correct id.

In the end I opted for a solution which cause the browser to update its href (probably) after the dom has loaded.

Preview URLs

https://deploy-preview-73--cdf-website.netlify.app/ways-to-run/#online
https://deploy-preview-73--cdf-website.netlify.app/ways-to-run/#in-person
https://deploy-preview-73--cdf-website.netlify.app/ways-to-run/#remote

What's changed

  • General yarn update ran
  • Removed useless <Questions /> section in ways-to-run (probably copy-pasta)
  • Removed useless package-lock.json, as we use yarn.
  • Fixed anchor scrolling.

@DanielBrierton
Copy link
Member

DanielBrierton commented Sep 25, 2020

Deploy preview for cdf-website ready!

Built with commit c289fde

https://deploy-preview-73--cdf-website.netlify.app

The app needs to know to look in /node_modules for stuff, and I wasn't
sure how to configure that.
This forces the browser location to add in the hash, causing it to
scroll to the correct place.  nextTick is used to cause this to happen
on the next dom update, which works, I think
@patch0 patch0 merged commit 82311e9 into master Sep 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants