-
-
Notifications
You must be signed in to change notification settings - Fork 188
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
Snappoints on showing multiple slides #19
Comments
Hello Mark (@mrksmts), Thank you for taking the time to report this issue + the clear sandbox example 👍🏻. Have you tried setting the I’d very much appreciate if you can confirm if this is the functionality you’re looking for. All the best |
Hi David (@davidjerleke) I am not sure that would work because we would like to be able to slide per item. And in the example the slide width is 40% so it would always be 2 but If you make it 250px for example and the carousel 100% it really depends on the width of the viewport and the amount of slides in the view that would determine the snap points. Best, Mark |
Hi Mark (@mrksmts), I understand your point of view. In the example you provided slide 4 and 5 share the same snap point because of I don’t know what a good solution for this would look like. The current implementation of Maybe we should consider a new option. What do you think? |
Hi David (@davidjerleke) What do you think about something like a boolean called |
Hi again Mark (@mrksmts), Thanks for getting back to me. Let me try this in code and see if it’s an easy fix or if there are some unexpected consequences with this 🧐. I’ll get to it as soon as possible, I have a newborn getting my primary attention at home so thank you for being patient 👶🏻🍼. Best, |
Wanted to ask the exact same thing and found this open issue right now.. made more or less the same example... https://codepen.io/sachamps/pen/XWrXvGq If you could point me to the best place in your code to get a hand on it i would at least try to make a PR which you could review... If not no problem... Congratulations 👶🏻!!! |
Welcome Sacha (@SachaMPS), Thank you 👶🏻. And another good example illustrating the feature request clearly 👍🏻. What’s your opinion on this?
❓ I’ll point out the code responsible for this as soon as I’ve access to my computer 🙂. Thank you in advance, |
HeyHo @davidjerleke, i am just reading (and logging :) through your code to find out how all the stuff works. Right now I would try not to mess with the anything too much at all. I am asking myself if the API call EDIT: As an example what I did on my first try to achieve that engine.ts - expose a new constant distinctPositions
index.ts - compare the index with the length of distinctPositions
|
Hi Sacha (@SachaMPS), We could make Example:
👉 See CodeSandbox In order to setup dot navigation there's a useful API method We need to solve this too... |
@davidjerleke I am not sure if a dot navigation makes sense width that special kind of UserOptions at all... I mean what does the Dot-Navigation mean in that case... I think having 5 slides but only three dots to navigate would be totally irritating. But maybe you are right and talking about UX aspects isnt the right way to think about it..... I will take a look at scrollSnapList tomorrow and give this thing another try... |
@SachaMPS, it’s not obvious to me that the number of slides has to match the number of dots. In a real world usage example carousels generally don’t have obvious slide numbers like in the example I sent you. They often contain images or maybe a combination of text and an image. I’m not sure if users will be aware of or bother about the number of dots, as long as all slides are reachable? If slide widths are small enough so 👉🏻 CodeSandbox In the example above That’s why I think we should consider merging excessive snap points that don’t trigger any scroll. But as you can see in the discussion above, I’d be happy if we can find a good solution for this. |
Hi Mark (@mrksmts), Just want to let you know that I'm working on this. I've not decided if: A. Snap points that don’t trigger any scroll will be merged automatically. But at this point I've tried this in code (in an ugly way) and I have a working draft. I'm hoping to get some time soon to finish this and wrap it up. Best, |
Hi David (@davidjerleke) Thanks! That's great to hear. You could put it in by default and give the user the option to turn it off or the other way around. Let me know if I can test or help with anything. Best, |
Hi Mark (@mrksmts), I'm very happy to announce that release v2.4.0 comes with the functionality you're looking for 🚀. I decided to go with Embla automatically merging excessive snap points that share the same position, rather than making it an option. The reason being is that I couldn't think of any use case where it makes sense to have navigation that triggers no scroll at all. I'd very much appreciate if you could test the new behaviour and give me feedback. Install the latest version: npm install embla-carousel@latest ...or yarn add embla-carousel@latest Thank you in advance 👍. Kindly, |
Hello Mark (@mrksmts), Thanks! |
Closing due to inactivity. Feel free to re-open this issue if you don’t think it’s working as expected. Thanks for opening this issue and improving Embla 👌🏻! |
Hi @davidjerleke! Sorry I didn't take the time get back to you earlier, seems like this works as expected! It is live and working like a charm! Thanks a lot! Best, Mark |
Hello Mark (@mrksmts), Thank you for getting back to me, I appreciate it. And I'm glad it seems to be working as expected. Enjoy! Kindly, |
Hello Mark (@mrksmts) and Sacha (@SachaMPS), I just wanted to let you know that I'm going to release Embla v.3 as soon as possible which will allow devs to choose between keeping redundant snap points or trimming them when using containScroll: const options = { containScroll: 'trimSnaps' }
// or
const options = { containScroll: 'keepSnaps' } Cheers! |
Currently I am implementing Embla Carousel in a project where we have multiple slides in the viewport at once, this basically means 2.5 slides are always visible.
When we containScroll and align start the items the snappoints for slide 4 and 5 are the same so it feels there should be one less snappoint for these settings.
I've setup a sandbox forked from one of the other issues to explain this issue: https://codesandbox.io/s/embla-carousel-loop-false-xdpsb?fontsize=14
The text was updated successfully, but these errors were encountered: