-
Notifications
You must be signed in to change notification settings - Fork 553
Table not scrollable on Mobile #365
Comments
Here is an example that will not scroll in mobile. |
I ran into this a few weeks ago. Turns out touch events need to be explicitly captured and handled to get scrolling on mobile devices. The site examples offer a good starting point, check out this commit |
I'm having this issue as well, has anyone come up with a good solution? |
Hi, Scrolling for mobile is not automatically built in. So you need to go through the steps of adding the mobile scroll wrapper as per the commit example posted by vinayaknagal above. Hopefully they build this feature in to a future version as I imagine almost everyone wants support for mobile. |
Hi, It's reset using the _handleScroll function, not due to the component "reseting" and setting the initial state. I've updated TouchWrapper/TouchableArea to use ES6 class + export so I can use import instead of require, that's the only updates to those files. Here are my relevant files: Any ideas? Edit: I worked out the reset problem by not calling this.props.scroller.doTouchEnd(e.timeStamp) in the handleTouchEnd in TouchableArea.js along with only setting a new top + left value in state if they are > 0.
|
I've tried the Zynga Scroller as per the TouchWrapper/TouchableArea example, with the helpful hints provided by @ssolders and @vinayaknagpal . However, because Zynga Scroller simply sets props.scrollLeft and props.scrollTop, which according to #202 has no effect after mount. Due to #202, I've been forced to use an older version of FixedDataTable (the July 22nd version of the branch featured in #216 's pull request), which is inconvenient. I'm not even sure whether it works yet, but I'll post back once I try. I second @CoderBlaine in advocating that Facebook "build[s] this feature in to a future version as I imagine almost everyone wants support for mobile." UPDATE: UPDATE 2: UPDATE 3: |
I'm not familiar with Zynga, TouchWrapper etc but I used the following code. I'm new to this so there is probably an easier way but this seems to work. One thing I noticed was that I had to turn off the scroll bars temporarily when on the desktop for the scrollTop and scrollLeft functions to work after the first render. I've got them permanently turned off on mobile. `
` Any suggestions for improvements gratefully received :-) |
I've created a simple table and it displays fine on pc however when viewing it on mobile it does not scroll.
However the examples seem to scroll any idea what would cause this?
The text was updated successfully, but these errors were encountered: