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

onClick handler in custom cell isn't getting called on mobile devices with touchScrollEnabled #20

Closed
CodeStrumpet opened this issue Jun 27, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@CodeStrumpet
Copy link

I migrated our fixed-data-table project over to use the fixed-data-table-2 with the new touchScrollEnabled feature and the scrolling with momentum on mobile devices is awesome. However I was experiencing an issue where the onClick handler on my cell component wasn't getting called.

I ended up commenting out the event.preventDefault() lines in the onTouchStart and onTouchEnd functions in ReactTouchHandler.js. That fixed the problem for me and as of yet has not caused any additional issues I have noticed with the scroll functionality.

I mainly just wanted to highlight this in case it's useful. I'm also curious though, is it an issue that other people have noticed, or is it perhaps getting caused by some conflicting code specific to my project? Also i'm curious if there are expected consequences I should be aware of due to disabling the event.preventDefault functions in onTouchStart and onTouchEnd.

Thanks!

#5

@wcjordan
Copy link
Member

wcjordan commented Jun 28, 2016

Thanks for creating the issue! I think this is just a case of overzealous calls to preventDefault.
I've updated PR 19 to include the fix you've suggested.

One thing I noticed while playing with this is previously tapping a row on my android would not select text in that row, while now without the prevent defaults, it will select the text tapped on. Scrolling is unaffected and will not result in selecting text. This seems correct, as the implementer of the cell should be responsible for capturing events and deciding if they should propagate.

@wcjordan wcjordan added the bug label Jun 28, 2016
@wcjordan wcjordan added this to the 0.6.6 milestone Jun 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants