Skip to content

Swipeable on Android throws exception if component is removed #48

Closed

Description

@tallenh

I have a FlatList with Swipeable items. I have a handler onSwipeableLeftOpen that will remove the item from the list. Each item also has a checkbox that when clicked will remove the item from the list. If the only way you remove items is to swipe them away everything works great. If you click the checkbox the item is removed, but the next time you touch the list it will throw an exception.

I have only tested this on Android.

I tried to debug but I haven't had much luck tracking it down. I can say the exception is thrown in GestureHandlerOrchestrator.java line 318:

  throw new IllegalArgumentException("Parent is null? View is no longer in the tree");

I have a small example of this at
https://gist.github.com/tallenh/dfebf73859cca956bf8d6f31ccc4bf7c

Activity

  1. kmagiera commented on Oct 30, 2017

    @kmagiera
    Member

    Thanks for reporting @tallenh I'm going to take a look at this soon

  2. osdnk commented on Nov 4, 2017

    @osdnk
    Contributor

    I also came across this issue and made a PR. It works in my case

  3. kmagiera commented on Nov 10, 2017

    @kmagiera
    Member

    @osdnk have you managed to repro this issue on the example app @tallenh provided: https://gist.github.com/tallenh/dfebf73859cca956bf8d6f31ccc4bf7c

  4. osdnk commented on Nov 10, 2017

    @osdnk
    Contributor

    Yes. I've just pasted this gist into app
    GenyMotion, Nexus 5, API 23

  5. kmagiera commented on Nov 14, 2017

    @kmagiera
    Member

    Thanks a lot @tallenh for reporting this issue. I allowed me to catch two serious problems with Android implementation. These are fixed in #53 which will go out in the next release today or tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions