Add class to cell closest to selected alignment at any time
Slide doesn't selected during swype. It selected after swype. If I do swype I can't see which slide will be selected when I detach a finger from a touch screen.
Could you provide a reduced test case? See Submitting Issues in the contributing guidelines.
Built a reduced test case here to replicate this issue. It is the case. The is-selected class doesn't move to the relevant cell until after the finger is lifted off the screen. I'm guessing due to being linked to touchend?
@madebydominick thanks for the CodePen
This cell selection behavior is by design. A selected cell is not the one closest to the selected alignment, it is the one that will end up at the selected alignment. This allows users to flick past a cell, or move forward, then back to a previous cell. There's no way to know what cell will be selected until after the drag (or swipe) has ended.
It sounds like what you're looking for is an additional selected class, that selects the cell closest to the selected alignment at any time. If others would like to see this feature added, please +1 this issue.
@wgstjf This sounds like a separate issue. I've deleted your comment here and moved discussion to #69
I do need this feature too, having the .is-selected element changing during swiping.
See my solution for adding is-previous and is-next classes to the previous and next cells: https://github.com/metafizzy/flickity/pull/227#issuecomment-135107460
Closing this issue here. Keep discussion to 227
I'm sorry, I don't see how these two issues are related to each other. What we asked for is a .selected class for the item that will probably be selected (so the one that's in the middle) DURING SWIPING. The .is-previous and .is-next are set AFTER THE SWIPING. That doesn't help.