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.65k stars 5.48k forks source link

[Magellan] Active class isn't added when scrolling #11524

Closed diniscorreia closed 6 years ago

diniscorreia commented 6 years ago

On 6.4.3, the active class is only added to Magellan links when clicking on them – scrolling through the page doesn't add the class.

Example on CodePen.

I don't really get what's causing the issue, but it seems that data-events="scroll" isn't being added to the Magellan element.

DanielRuf commented 6 years ago

Please test it with the is-active class: https://codepen.io/DanielRuf/pen/EdgpOe

diniscorreia commented 6 years ago

Ah, silly me, didn't even notice the classes were being added.

I do think I stumbled upon another issue with Magellan on the project I'm working right now: I load Foundation and some of the plugins with my other scripts – but I also asynchronously load specific plugins when I need them (reinitialising Foundations on the elements I need). It seems Magellan doesn't catch the scroll event when loaded this way. Is there anything particular on the first time Foundation inits that might prevent Magellan from working correctly?

DanielRuf commented 6 years ago

I guess we might have fixed the async initialization issues in the latest RC release.