Closed rubberbandage closed 8 months ago
Hi @rubberbandage,
Thank you for your bug report. If I’m understanding you correctly, this limitation is known. In other words, Embla doesn’t guarantee that having slides wider than the viewport will work. From the slide sizes section in the docs:
Best, David
Understood, thank you for directing me to this page David
I'll need to have a word with the designer to see how we can tweak the UI so we can abide by this rule; I may be able to approach it with slides having 100% on small screen, and auto for anything larger.
If there were no plans to address the comment about make sure slide sizes don't exceed the size of the viewport - I'm happy for this bug to be closed.
Thank you David
@rubberbandage at the time of writing I’m not planning to look into this. Most cases with slides wider than the viewport works as expected except slidesToScroll: auto
. But as mentioned it’s not supported officially.
However, the slidesToScroll
feature has sufficient tests so if you would like to try solving it you’re welcome to try. Bear in mind that a good solution doesn’t only solve the problem but it also doesn’t increase the bundle size much.
Let me know if you intend to look into it.
Best, David
Likely not actively at this stage, if the above works for current scenario, thought I am curious about finding a solution; so if I find some time up my sleeve, I'll see what I can do - will keep in mind code coverage and bundle size.
Should I find time, I will open a PR
Thank you again
Bug is related to
Embla Carousel version
with dependencies on
Describe the bug
Currently experiencing an issue where if the screensize is smaller than the width of a slide, an error is thrown
Please note that for this; I am using the following styling for a slide;
Should flex-basis with auto not be appropriate - please disregard issue; as I have gone against the documentation listed here https://www.embla-carousel.com/get-started/react/
Thank you
Read on...
I am using auto as I didn't want to lock slides into any particular sizing, and allow the children to provide their width (and these can be differing) The component is working beautifully and as intended, and I am really loving this carousel; however, I have come across a use case which breaks with only the above change, and having the screen size shorter than a slide
After some debugging, I have located a potential area of interest -
bySize(array)
Given an array of 5 items of equal width; but the screen size is smaller than the width; an additional item is returned from
bySize(array)
I believe the bug to be within bySize, and returning an extra empty item at beginning of array;
Snapshot at time of issue
The downstream usages of this value fail on finding a 'right' property; which with an empty item, leads to undefined
CodeSandbox
Steps to reproduce
Set
.embla__slide
withflex: 0 0 auto
Set EmblaCarousel options to{ slidesToScroll: 'auto' }
Open sandbox, and drag resizeable window to less than width of a slide.
Expected behavior
Additional context