-
Notifications
You must be signed in to change notification settings - Fork 528
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
Cannot close row: keyExtractor doesn't appear to be honored in rowMap when 'key' attribute present in row item #547
Comments
Hey @rpattcorner, I never thought that if objects had a Currently a Can you please go to
to
And let me know if that fixes your issues, thanks! |
@jemise111 , thanks for the quick response! Yes, the proposed one line substitution fixes the problem for my app! Any reason to hold out for a push before sending my next build to testers? |
(hold on a minute, seeing a problem, likely unrelated) |
@rpattcorner I just released version v3.2.7 which will now favor I will leave this issue open per your latest comment, but please close this if it is unrelated, thanks! |
Thanks! It looks to me like the issue I experienced (a freeze on navigation) is unrelated, and seems to correlate with running both an older Android emulator and a real Android device at the same time, but I'll download the new version and bang on it awhile, then close if all still seems well. Again, much appreciated. Those edge cases are like 'who's on first'. |
I did see this, which is new and possibly relates, just FWIW:
|
@rpattcorner IMO that shouldn't be something related to this lib but I'll keep an eye out for other reports |
Looks good, many thanks! Closing. |
I found that |
@code-by hitting the same issue. Have you managed to figure it out somehow? |
I've got a corner case perhaps ... my application is a music application, so its data.item object has an attribute called, lterally, 'key'.
Per #449 and general practice, I use a keyExtractor in the
<SwipeListView>
, just like I do in the<FlatList>
that I'm trying to replace. FlatList works fine.In the FlatList my keyExtractor looks like
keyExtractor={item => item.tune_id}
, but I've changed it tokeyExtractor={(item, index) => item.tune_id}
per #449 just to follow available advice. Makes no difference to the problem, which is an inability to close a row.So, for completeness, we have:
and you'd think all would be well. As you can guess from the title of this issue, my item looks like:
and in my vanilla closeRow function:
The rowMap appears to be ignoring the
keyExtractor
. Have a look at this debug view from Chrome, in whose underlying data there are 3 tune items, two in the key of G and one in the key of D, with the 'D' tune slid to the left, and a click on the close button that invokes closeRow. Note that the second 'G' tune does not show up, and more importantly, the rowMap seems to be keying off the literal 'key' attribute of the item instead of the keyExtractor mapping:As you can see there are two rows in the rowMap, not the expected 3. Possibly because two of the tunes have the same (literal)
key
attribute. This could be a hint, or an effect, not sure.And there's no way that rowMap[rowKey], which should literally be rowMap['@tune_id.482'] is ever going to find a row to close.
@jemise111 am I (hopefully) doing something simple and obviously wrong here?
The text was updated successfully, but these errors were encountered: