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

Hash change event not firing #106

Open
Flowrome opened this issue Dec 2, 2019 · 1 comment
Open

Hash change event not firing #106

Flowrome opened this issue Dec 2, 2019 · 1 comment

Comments

@Flowrome
Copy link

Flowrome commented Dec 2, 2019

Stencil version:

 1.8.1

I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request

Current behavior:
When using hashchange listener with historyType="browser" the event is not firing:

<stencil-router historyType="browser">
...
</stencil-router>

private hashChangeHandler(): void {
window.addEventListener('hashchange', (e) => {
      console.log(e)
    })
}

Expected behavior:
even if i use the browser navigation the hashChange listener should work

Steps to reproduce:
Just start a Stencil application with stencil router and navigate programmatically on a route with an hash and add a hashchange listener.

Thank you for your work.

Romeo Nupieri

@threeaccents
Copy link

threeaccents commented Mar 22, 2020

I'm on the same boat. In the mean time if you want you can just use a regular a tag as it won't cause a page reload if you're just updating the hash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants