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

Not working when href is of the form "/#my-hash" #1

Closed
CloudPower97 opened this issue Dec 3, 2018 · 0 comments
Closed

Not working when href is of the form "/#my-hash" #1

CloudPower97 opened this issue Dec 3, 2018 · 0 comments
Assignees
Labels
bug Something isn't working
Projects

Comments

@CloudPower97
Copy link
Owner

CloudPower97 commented Dec 3, 2018

For example:

<a href="#first-section">First Section</a>

does work and React Spy correctly initializes.

<a href="/#first-section">First Section</a>

Doesn't work, React Spy even crash.

This is beacause we use

document.querySelector(`[href="#${item}"]`)

to get the navItems.
And it crashes because we don't double check that navItems array actually has non-null values.

@CloudPower97 CloudPower97 added the bug Something isn't working label Dec 3, 2018
@CloudPower97 CloudPower97 self-assigned this Dec 3, 2018
CloudPower97 added a commit that referenced this issue Dec 3, 2018
Correctly handling href like `/#my-hash`

Preventing crash when `navItems` doesn't get initialized correctly

Closes #1
@CloudPower97 CloudPower97 added this to In progress in React Spy Dec 3, 2018
React Spy automation moved this from In progress to Done Dec 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant