foundation / foundation-sites

The most advanced responsive front-end framework in the world. Quickly create prototypes and production code for sites that work on any kind of device.
https://get.foundation
MIT License
29.64k stars 5.5k forks source link

Magellan w/ deep linking doesn't clear the hash when there's no longer an active link #10836

Closed nvenegas closed 6 years ago

nvenegas commented 6 years ago

How to reproduce this bug:

On a page with with Magellan and data-deep-linking enabled and a top-margin greater than data-threshold (defaults to 50px) such that there is no active link until you scroll past that top-margin:

  1. Load the page (without a hash).
  2. Scroll down to the first Magellan-tracked element such that the window's location updates to that element's ID (e.g., #first-heading).
  3. Scroll back to the very top (e.g., by pressing HOME on your keyboard).

What should happen:

What should happen after each of the steps to reproduce:

  1. The window's location should not have a hash.
  2. The window's location should have a hash of #first-heading.
  3. The window's location should not have a hash.

What happened instead:

What actually happens after each of the steps to reproduce:

  1. The window's location does not have a hash.
  2. The window's location has a hash of #first-heading.
  3. The window's location has a hash of #first-heading.

Browser(s) and Device(s) tested on:

Chrome 63.0.3239.84 on macOS Sierra (10.12.6)

Foundation Version(s) you are using:

6.4.3

nvenegas commented 6 years ago

I'll have a pull request with a fix up shortly!

nvenegas commented 6 years ago

The bug is reproducable in the magellan/active-item.html visual test (via npm run test:visual).