visionmedia / page.js

Micro client-side router inspired by the Express router
http://visionmedia.github.com/page.js
7.67k stars 687 forks source link

Ensure we are on the same page when exiting for hashes #451

Closed matthewp closed 6 years ago

matthewp commented 6 years ago

The onclick listening tries not to do anything when navigating to a hash within the same page. However previously it did not take the search into consideration so when you were on a page with a query param and then navigating to the same path, without a query param, but with a hash, it would cause a page navigation.

Fix is to include the search in this algorithm. Fixes #289

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.1%) to 91.379% when pulling 63ecd88b136d587991336e7374704677cbe85a65 on query-hash into 1a4a665394d59693e0d465b724eac4c89c710eaa on master.