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

SmoothScroll options can't be set #11620

Closed
Renkas opened this issue Dec 4, 2018 · 1 comment · Fixed by #11622
Closed

SmoothScroll options can't be set #11620

Renkas opened this issue Dec 4, 2018 · 1 comment · Fixed by #11622

Comments

@Renkas
Copy link
Contributor

Renkas commented Dec 4, 2018

What should happen?

I should be able to set smoothScroll options via data attributes.
data-offset="100" data-animation-duration="1"

What happens instead?

These attributes are ignored

Possible Solution

I believe problem is in _handleLinkClick method https://github.com/zurb/foundation-sites/blob/develop/js/foundation.smoothScroll.js#L60
this is always undefined. So this.options is also undefined. So only default options will ever be used.

Test Case and/or Steps to Reproduce (for bugs)

Codepen in Foundation 6.5.1: https://codepen.io/anon/pen/QJPpbQ
Note that there is no offset and the scroll does take 500ms - instead of 1ms.
Also the scroll stops before actually reaching the element.

Your Environment

  • Foundation version(s) used: 6.5.1
@ncoden
Copy link
Contributor

ncoden commented Dec 10, 2018

Hi @Renkas 👋,

Thank you for your issue.
Thanks to @ben-z, this should be fixed by #11622.

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

Successfully merging a pull request may close this issue.

2 participants