Open eugene-lazarev opened 6 years ago
Hi @eugene-lazarev ! In the Slick documentation (http://kenwheeler.github.io/slick/), the "settings" part specifies that the initialSlide
setting must be of type integer
, so I'm not sure that converting strings to integers is the best solution (a.k.a the user should be responsible for that). However, perhaps type checking should be put in place to give the user an informative error if they fail to provide the right type - right now it fails silently, and the user might not know what they've done wrong.
I'd be willing to take this on, but I need the blessing of the maintainers @kenwheeler @simeydotme
Thanks @DHDaniel, But I'm pretty sure the best way to do something in IT is to predict user's mistakes and fix it 'under the hook' without any notice.
Because this is Javascript, you know, here is the difference between 1
and "1"
is extremely small.
It's obviously that user wants to set initialSlide on 1, not "1". I can't see any reasons why don't help him without any noise :)
Anyway, I respect any of your decision here. Thanks again.
====================================================================
[ http://jsfiddle.net/t2hrte78/1/ ]
====================================================================
Steps to reproduce the problem
initialSlide
to"0"
or"1"
(String type).1
to11
).====================================================================
What is the expected behaviour?
Slick goes to 3-rd slide after 2-nd.
====================================================================
What is observed behaviour?
Slick goes to the 12-th slide after 2-nd (from
1
to11
).====================================================================
Simple solution
Please use
parseInt
function for must-be-numeric variables sent by the user.====================================================================
Thanks for great carousel!