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

slickAdd and slickRemove methods not implemented #1061

Closed
laveesingh opened this issue Feb 27, 2018 · 4 comments
Closed

slickAdd and slickRemove methods not implemented #1061

laveesingh opened this issue Feb 27, 2018 · 4 comments

Comments

@laveesingh
Copy link
Contributor

No description provided.

@laveesingh
Copy link
Contributor Author

Not going to be implemented, the same functionality can be achieved as with dynamic slides. See dynamic slides example.

@Mr-Chilly
Copy link

Mr-Chilly commented Mar 2, 2018

tbh I'm not sure this is correct. I am trying to add and remove a slide for opposite ends of an array:

(assuming we progress the slider to the right one)
[0,1,**2**,3,4] => [1,2,**3**,4,5]
but I've no control over the index slide, so in actual fact I end up with:[0,1,**2**,3,4] => [1,2,3,**4**,5]

Changing the array seems ok, but without actually having control over slideIndex as in the vanilla slicks add/remove examples I can't see how to accomplish this

@laveesingh
Copy link
Contributor Author

I'm not sure I understand your query, but Dynamic Slides example should help you.

@Mr-Chilly
Copy link

Mr-Chilly commented Mar 15, 2018

Sorry I'll try and be clearer...

https://codesandbox.io/s/z3yy44vyyp

I need to load new content into the slides, and remove old content (see ternary switch swapping the arrays in the example). However, whenever I load more content in, I still need the active slide (the center one) to be in the same position. currently, it'll shift one to the 'right'

(imagine here I'm loading the content on each progression, rather than a button click)

With access to the slideIndex I can manually update this; setting the index slide 'back' one - giving the illusion that nothing has changed in the slider:

[*1*, 2, 3, 4, 5] = 1 is active, user progresses to slide 2
[1, *2*, 3, 4, 5] = 2 is now active, so load new content...
[2, *3*, 4, 5, 6] = 3 is now active...

Dynamic slides work very well in situations where the fundamental slides don't change, however removing slides that are previous to the active slide doesn't keep the index correctly.

If I can change the slideIndex, or even activeSlide this would be trivial!

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

No branches or pull requests

2 participants