This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Didier Clerc
Posted Feb 16 - Read on Facebook

I am new to Framer and I try to create a simple interface with a lot of buttons. To do that I am using Arrays and I would like to detect on which button the user performs a Tap. I assign the onTap listener on the button within a for-loop but every time I tap a button, I get the index of the very last element of the array, not the one I tapped. Any idea why? and how to perform what I want?

Here is my prototype:

Thank's a lot for your feedback!


Arie Aulia Nugraha

You might want to add context to the loop using "this" or "@"

For example

<for loop>
.. button.onTap →
... print

Didier Clerc

and... that is working! thank you!

Read the entire post on Facebook