dragFree options is false (initial)dragFree to true, resize codesandbox browser width up to 640px. I wrote breakpoint options in embla.css.dragFree options is true.dragFree options is still true.I don't understand whole code base yet, I guess options are overwriting when activate() called.
just now, I can avoid this bug like this:
const Embla = styled('div', {
'&:before': {
display: 'none',
content: `'{"dragFree":false}'`,
},
variants: {
size: {
lg: {
when: {
desktop: {
'&:before': {
content: `'{"dragFree":true}'`,
},
},
},
},
},
},
}
I love your works. keep going to good things.
Hi @iamchanii,
Nice catch! And thank you for the clear issue description. The pseudo options is still experimental so it鈥檚 great if we can solve any related bugs at this stage.
Looking at the code, I can see why this is happening and I missed to cover this case. I鈥檒l look into this and will let you know when I鈥檝e done so.
Best,
David
Hi @iamchanii,
Try this CodeSandbox which includes a patch fix for this bug. Feel free to try it in combination with the initializer options:
const [emblaRef, emblaApi] = useEmblaCarousel({ loop: false }) // <-- this is the initializer options
And here's a specification of how it's expected to work.
Let me know how it goes.
Best,
David
@davidcetinkaya Hi, I checked out csb. it works like what I expected! is something fixed in embla-carousel-react.js or did I use it wrong?
@iamchanii thank you for testing 馃憤馃徎.
You did everything right so I can confirm that this is a bug. I added the embla-carousel-react.js file which includes a fix for this bug.
I鈥檒l let you know when I鈥檝e released the fix publicly which will be with v4.3.1.
Best,
David
Hi @iamchanii,
I've released v4.3.1 and it includes a fix for this bug. Install the latest version and the issue should be gone. Please let me know if it's working as intended. Thank you for your help.
Best,
David