Uh oh!
There was an error while loading. Please reload this page.
[Bugfix][SwipeableFlatList] Fix SwipeableFlatList on close - #16682
[Bugfix][SwipeableFlatList] Fix SwipeableFlatList on close#16682kesha-antonov wants to merge 2 commits into
Conversation
pull-bot
commented
Nov 5, 2017
@facebook-github-bot label Needs more information @facebook-github-bot label Needs more information Generated by 🚫 dangerJS |
eballeste
commented
Nov 9, 2017
What if we don't want the other rows to close automatically? |
kesha-antonov
commented
Nov 9, 2017
Read source. It's by design |
Reviewed By: sahrens Differential Revision: D5912488 fbshipit-source-id: 3d2872a7712c00badcbd8341a7d058df14a9091a
@kesha-antonov can you check, I think with your current solution all rows are rerendered on every swipe. If I'm wrong, cool then. |
| type State = { | ||
| openRowKey: ?string, | ||
| extraData: { |
There was a problem hiding this comment.
why do we need extra object inside state? isn't it simpler keep it as before but put into flat list extraData={this.state} ?
There was a problem hiding this comment.
Following the example in https://facebook.github.io/react-native/docs/flatlist.html
By passing extraData={this.state} to FlatList we make sure FlatList itself will re-render when the state.selected changes. Without setting this prop, FlatList would not know it needs to re-render any items because it is also a PureComponent and the prop comparison will not show any changes.
facebook-github-bot
commented
Dec 5, 2017
@kesha-antonov I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
| this._shouldBounceFirstRowOnMount = this.props.bounceFirstRowOnMount; | ||
| this.onRefFlatList = this.onRefFlatList.bind(this); |
There was a problem hiding this comment.
This code works faster than fat arrow.
In render we should avoid create function every time
@tomasreimers
There was a problem hiding this comment.
@kesha-antonov totally get that -- I meant why .bind(this) in the initializer instead of using class fields (like _onScroll)
vysotsky
commented
Jan 14, 2018
Waiting for this fix to be merged? Any updates on it? |
kesha-antonov
commented
Jul 16, 2018
ping |
tomasreimers
commented
Aug 7, 2018
Hi @kesha-antonov , I think this was fixed by #18001 |
Motivation
This commit d8cc6e3 introduced
SwipeableFlatListIt has bug - doesn't close on swipe other rows.
I fixed it.
Release Notes
[IOS/ANDROID] [BUGFIX] [SwipeableFlatList] - opened rows did not close on swipe other rows