Skip to content

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

Closed
@CloudPower97

Description

@CloudPower97

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions