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

Stop calling onLoad callback when a hash changes #3155

Closed
lilaconlee opened this issue Jan 16, 2019 · 4 comments
Closed

Stop calling onLoad callback when a hash changes #3155

lilaconlee opened this issue Jan 16, 2019 · 4 comments
Labels
stage: ready for work The issue is reproducible and in scope stale no activity on this issue for a long period type: breaking change Requires a new major release version

Comments

@lilaconlee
Copy link
Contributor

lilaconlee commented Jan 16, 2019

In the browser, a hashchange event does not also fire the onload event. In Cypress, if you visit a page and then visit a hash on that page, the onload callback is called. This should be updated so that the onLoad callback is not called when visiting a hash on the same page.

To reproduce:

 cy.visit('https://docs.cypress.io/guides/overview/why-cypress.html#Our-mission', {
   onLoad: onload,
   onBeforeLoad: onbeforeload
 })

 cy.visit('https://docs.cypress.io/guides/overview/why-cypress.html#Cypress-ecosystem', {
   onLoad: onload,
   onBeforeLoad: onbeforeload
 })

Currently, onBeforeLoad then onLoad is called from the first visit then onLoad is called from the second visit.

After fixing, neither onLoad nor onBeforeLoad should be called.

@lilaconlee lilaconlee added the type: breaking change Requires a new major release version label Jan 16, 2019
@brian-mann
Copy link
Member

Agree, no *load callbacks should be fired on a cy.visit(...) where only the hashes change.

@jennifer-shehane jennifer-shehane added the stage: ready for work The issue is reproducible and in scope label Jan 24, 2019
@jime2003
Copy link

jime2003 commented Dec 6, 2022

Is there any update on this issue?

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Jun 5, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: ready for work The issue is reproducible and in scope stale no activity on this issue for a long period type: breaking change Requires a new major release version
Projects
None yet
Development

No branches or pull requests

5 participants