Skip to main content
Solved

How does the drag interaction on Photo carousel work?


Slavo

Hello,
I’ve played with the Playground file and got to the Photo Carousel. I don’t understand how it works. The interaction is just set to “On drag”. It doesn’t say “On drag left” or “On drag right”. How does Figma know which way the drag should be applied? I guess I’m missing something but right now it seems like magic to me 🙂

Best answer by Gleb

Figma Help Center
View original
This topic has been closed for replies.

6 replies

Gleb
  • Power Member
  • 4710 replies
  • March 8, 2021

The direction is based on where the object is moved to in the next screen. It can even be connected to two screens at the same time with different directions.

See example from this post: Need swipe gesture - #8 by Gleb


Slavo
  • Author
  • 7 replies
  • March 8, 2021

Thank you. Is there any documentation on this?


Gleb
  • Power Member
  • 4710 replies
  • Answer
  • March 8, 2021

  • 2 replies
  • February 8, 2024

Hi Gleb!

Thanks for all of your contributions, they have helped me a lot learning Figma. I am trying to do a simple on drag carousel but for whatever reason, the middle slide 2 gets confused which direction to go and doesn’t in your typical drag left and right manner, I am not sure what I am doing wrong. I also want to make it so the arrows do not slide with each slide and remain static on top of the slides. I made it a separate component and thought maybe smart animate would not animate them if they are matching names but they still move with the slide.

Figma – 8 Feb 24

Gleb
  • Power Member
  • 4710 replies
  • February 8, 2024

Your slides are overlapping each other:


  • 2 replies
  • February 8, 2024

Thanks - dumb error! But it’s still not working … would you mind taking another look? I just tried again. This time tried to make an infinity slider and it works but only going one direction still. I even went off one of your examples I found in a previous thread but for some reason can’t figure out what I am missing (it is driving me crazy). Behaves as I want swiping left. Thank you so much!!

Figma – 8 Feb 24

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings