Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GridTile] onTouchTap events #2413

Closed
rdagger opened this issue Dec 7, 2015 · 3 comments
Closed

[GridTile] onTouchTap events #2413

rdagger opened this issue Dec 7, 2015 · 3 comments
Labels
component: image list This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation

Comments

@rdagger
Copy link

rdagger commented Dec 7, 2015

How would you associate an onTouchTap event with a GridTile?

I can add an onTouchTap to a GridTile now but the event target will be different depending where the user clicks in the tile (div, img, span, etc.) Therefore, it makes it very difficult to determine what tile the user clicked. It would be great if there was a native onTouchTap event like there is for ListItems.

@rdagger
Copy link
Author

rdagger commented Dec 7, 2015

This is how I'm currently handling tile click events based on the React article Communicate Between Components:

<GridTile onTouchTap={this._tileClick.bind(this, myImage._id)}>
_tileClick(id){ console.log(id); }

It would great if the GridList component had an event to catch tile clicks.

@alitaheri alitaheri added the new feature New feature or request label Dec 9, 2015
@Natim
Copy link

Natim commented Mar 6, 2016

This fxed it for me too. Could we add an example in the docs?

@oliviertassinari oliviertassinari added the component: image list This is the name of the generic UI component, not the React module! label Oct 22, 2016
@oliviertassinari oliviertassinari changed the title GridTile onTouchTap events [GridTile] onTouchTap events Jan 1, 2017
@oliviertassinari oliviertassinari added docs Improvements or additions to the documentation and removed new feature New feature or request labels Jan 1, 2017
@oliviertassinari
Copy link
Member

oliviertassinari commented Jan 1, 2017

This is how I'm currently handling tile click events

That's the idiomatic React way to handle events. You set a callback on the component you are interested in. That onTouchTap should be working on all our component. I don't think that we need an extra documentation for it.
I'm glad you figured out a solution. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: image list This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation
Projects
None yet
Development

No branches or pull requests

4 participants