Skip to content
This repository has been archived by the owner. It is now read-only.
This repository has been archived by the owner. It is now read-only.

Navigating back to the same VM and going to it again is not working #233

@sescandell

Description

@sescandell

Steps to reproduce

  1. Create an app with only one VM and a fragment to display it (suppose the VM has one property ID)
  2. From the fragment, create a Command to navigate to the same VM but with a different "criteria" (imagine navigating to a same object but with a different ID)
  3. Follow the navigation:
    1. Launch the app
    2. Display the VM with ID 1
    3. From this fragment, click on the button to navigate to the VM with ID 2
    4. Press the back button
    5. Press the button to navigate to the VM with ID 2

Expected behavior

The fragment with ViewModel ID 2 should be displayed

Actual behavior

Nothing happens

Origin of the issue

The ShouldReplaceCurrentFragment returns FragmentReplaceMode.NoReplace.

This is because when navigating to VM with ID 2, ShowFragment set the fragInfo.CachedFragment with informations about VM with ID 2. When we click on the back button, we so display back the VM with ID 1.
Then if we click again on the button to display VM with ID 2, the fragment's tag to display is the same as the one currently displayed but with informations from VM ID 2 (pressing the back button didn't update CachedFragment object in "currentFragInfo").

Keep it simple, issue is the cached Fragment is not updated on BackButton pressed if going back to a fragment with the same tag.

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