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

Hello,
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:

https://framer.cloud/oKuaJ/

Thank's a lot for your feedback!

2 Comments

Arie Aulia Nugraha

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

For example

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

Didier Clerc

and... that is working! thank you!

Read the entire post on Facebook