Code Monkey home page Code Monkey logo

Comments (11)

chiumax avatar chiumax commented on June 1, 2024 3

hey guys, running into the same issue with the WheelGesturesPlugin here's a snippet that sort of fixes this issue:

 embalaApi.on('settle', (api: CarouselApi) => {
        if (!api) {
          return;
        }
        const { limit, location, scrollTo } = api.internalEngine();
        if (location.get() > limit.max) {
          scrollTo.index(0, 0);
        }
        if (location.get() < limit.min) {
          scrollTo.index(embalaApi.scrollSnapList().length - 1, 1);
        }
      });

Ideally it would be nice to reset the momentum early so it never gets to this or take so long to rubber band back.

from embla-carousel.

davidjerleke avatar davidjerleke commented on June 1, 2024 3

Thanks @sarussss and @DanielSpindler. I'll throw a comment in here once the bug fix has been released.

from embla-carousel.

sarussss avatar sarussss commented on June 1, 2024 2

Hi @davidjerleke
I checked, the problem I had before has been resolved, great!

from embla-carousel.

davidjerleke avatar davidjerleke commented on June 1, 2024 1

Hi @DanielSpindler,

This was reported by @sarussss here but I havenโ€™t had the time to create a bug report:

Thanks for doing it for me.

Best,
David

from embla-carousel.

davidjerleke avatar davidjerleke commented on June 1, 2024 1

@DanielSpindler and/or @sarussss,

Can you reproduce this problem in this CodeSandbox?

from embla-carousel.

DanielSpindler avatar DanielSpindler commented on June 1, 2024 1

@davidjerleke https://codesandbox.io/p/sandbox/bug-785-forked-psk7k8?file=%2Fsrc%2Fjs%2Fembla-carousel.js%3A1857%2C25-1857%2C30 seems to work just fine, cant reproduce anymore

from embla-carousel.

DanielSpindler avatar DanielSpindler commented on June 1, 2024

Thanks alot and no Problem!

Greetings,
Daniel

from embla-carousel.

DanielSpindler avatar DanielSpindler commented on June 1, 2024

https://codesandbox.io/p/sandbox/embla-carousel-default-react-forked-vcjj84?file=%2Fsrc%2Fjs%2FEmblaCarouselArrowButtons.tsx updated the other CodeSandBox for now @davidjerleke, @sarussss seems like it is not gone, will update it in a live app today and give a feedback after

from embla-carousel.

davidjerleke avatar davidjerleke commented on June 1, 2024

@DanielSpindler did you try the CodeSandbox in this comment? Because a fix for this has not released yet!

from embla-carousel.

DanielSpindler avatar DanielSpindler commented on June 1, 2024

@davidjerleke my fault ive been reading it wrong sorry! do you have a version with
"embla-carousel-wheel-gestures": "^8.0.0-rc05"
cant reproduce with dragging anymore

from embla-carousel.

davidjerleke avatar davidjerleke commented on June 1, 2024

@DanielSpindler you can fork the CodeSandbox and add the Wheel Gestures plugin and test it if you want.

from embla-carousel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.