-
Notifications
You must be signed in to change notification settings - Fork 279
SortableList sometimes does not render at all. #56
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
Comments
HI! SortableList requires data to be object, try to pass object. |
I am having the same problem, and I could not find the pattern to reproduce still. Sometimes I feel it renders fine when I step through the code (component life cycle). P.S data is an object. |
Thanks! Passing an object instead of an array makes no difference as far as I can tell though. About 10% of the time the list simply does not render. The random nature of the issue makes it near impossible to reproduce indeed. It's a shame, since the 90% of times it is working, it is excellent. |
I report it here I try to fix but cant find the error. I think is something with local variables. The failing function is:
Dont resolve the promise sometimes. |
could you try version from this branch https://github.com/gitim/react-native-sortable-list/tree/fix |
SyntaxError /react-native-sortable-list/src/SortableList.js "nextOrder" is read-only Line 88: Change It seems that now it does not happen, I'll try more |
fixed |
I now get: "undefined is not an object (Evaluating this.props.order.forEach)" in componentWillMount() |
Yes, same problem |
it is bug, we should iterate over state.order there, fixed |
It should be this.state.order right?
But then I get: (Undefined not an object: rowsLayouts[key].height) on line 219 |
yes
strange, Basic example seems works fine |
try to log rowsLayouts in 218 line, it should contain layouts for row keys |
I fixed it wiht:
If dont receive order by props, generate new order |
@luisfuertes this commit e99beff should fix it |
Logged rowsLayouts and it prints an empty object {} Android, Samsung Galaxy Note 3, in case it is relevant. |
Yes, @gitim your commit fix it too |
If I pass an array as the data it works.
The list seems tor render every time now. Tried it about 100 times. Thanks! |
it is strange how it crashes on 219 line, because for empty object, Object.keys(rowsLayouts) returns empty array and forEach will not iterate at all. |
I am new to React Native and Javascript in this kind of context so I might have messed something up. But weird indeed, the for loop should not iterate over an empty object. The array works fine though., so its probably something in the rest of my code that screws it up. Maybe my row items? |
@DigohD I fixed it, stupid bug :( |
Confirmed working! Thanks for the help and for providing this great module! |
Cool, will publish a new version very soon! |
released 0.0.15 |
Thanks! Good job. My last suggestion is that apply scrollView style prop, for set padding. If you add padding to container, rows dont render above container view. Need add to scrollView style. Regards |
|
Oh yes i dindnt see, sorry |
Guys thanks for your good work. So how can I update my local version so that I get this fix? |
just update to 0.0.15
|
still have this bug. |
yup, still got this problem. |
Hello!
I have encountered a bizarre issue where the sortable list fails to render about 10% of the time. The parent component does render, and I know this since I have a test tag before the list which is rendered correctly. The data passed to the list is the same every time and does not change. The data is simply an array containing 6 numbers. Any ideas?
<SortableList style={layoutStyles.wrapper} contentContainerStyle={layoutStyles.contentWrapper} data={testData} renderRow={this._renderRow} renderFooter={this._renderFooter} sortingEnabled={this.state.isSorting}/>
The text was updated successfully, but these errors were encountered: