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

initialSlide is numeric and as such it should be treated with parseInt() #85

Open
quentinburley opened this issue Apr 24, 2015 · 1 comment

Comments

@quentinburley
Copy link

even though the current handling of initialSlide partially works:
"initialSlide: scope.initialSlide || 0,"
it really ought to be treated with parseInt() to force it into a numeric type, as kenwheeler slick.js expects it to be a numeric type and not a string.
for example in:
https://github.com/kenwheeler/slick/blob/1.5.2/slick/slick.js:399
^^^ (note that here the '+' operator is clearly arithmetic and not a string concatenator).

I suggest

  • initialSlide: scope.initialSlide || 0,
  • initialSlide: scope.initialSlide != null ? parseInt(scope.initialSlide, 10) : void 0,

as is currently the practice for other params that are to be treated as numeric.

@quentinburley
Copy link
Author

proposed fix:
#86

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

No branches or pull requests

1 participant