Describe the Issue in Detail
According to the documentation, the ReplacePage navigation command should only replace the current page with the new page referenced in the command parameter, leaving the previous navigation stack in-tact.
In my experience (and I could definitely be doing something wrong!), using the ReplacePage command in the context of an action panel functions the same as ShowPage – clearing the entire navigation stack and giving no back button.
Can reproduce in
Steps to Reproduce
- Create a new mobile page with a CMS block and insert the XAML listed below, but update the targetPageGuid lava variable to be any valid page guid within the app you're testing in.
- Add a button to the home page of your app, linking you to the new page you created in step 1 using a
PushPage command (this will create a navigation stack w/back button).
- Click the "Replace Page Test" button on your newly created page to open the action panel, then click both the
ShowPage and ReplacePage options.
- Observe that both options remove the back button, preventing you from going back to the previous page.
Expected Behavior
The ReplacePage navigation command should replace the current page with the page referenced in the CommandParameter attribute, leaving the navigation stack in-tact and retaining a back button.
Actual Behavior
The ReplacePage navigation command appears to function exactly like the ShowPage command - clearing out the navigation stack and showing the new page (at least within the context of an action panel).
Screenshots or Videos
Reproduction XAML
{% assign targetPageGuid = '94071cfe-2df5-42d0-a267-1046f08ae6a8' %}
<Button Text="Replace Page Test" Command="{Binding ShowActionPanel}" StyleClass="btn,btn-primary">
<Button.CommandParameter>
<Rock:ShowActionPanelParameters
Title="Choose a Command"
CancelTitle="Dismiss">
<Rock:ActionPanelButton
Title="Replace Page"
Command="{Binding ReplacePage}"
CommandParameter="{{ targetPageGuid }}" />
<Rock:ActionPanelButton
Title="Show Page"
Command="{Binding ShowPage}"
CommandParameter="{{ targetPageGuid }}" />
</Rock:ShowActionPanelParameters>
</Button.CommandParameter>
</Button>
Mobile Shell Version
6.0.0.0
Last Known Working Version
No response
iOS Device Type(s) and iOS Version(s)
iPhone 16 Pro, iOS 18.5 (22F76)
Android Device Type(s) and Android Version(s)
Google Pixel 7, Android 15
Describe the Issue in Detail
According to the documentation, the
ReplacePagenavigation command should only replace the current page with the new page referenced in the command parameter, leaving the previous navigation stack in-tact.In my experience (and I could definitely be doing something wrong!), using the
ReplacePagecommand in the context of an action panel functions the same asShowPage– clearing the entire navigation stack and giving no back button.Can reproduce in
Steps to Reproduce
PushPagecommand (this will create a navigation stack w/back button).ShowPageandReplacePageoptions.Expected Behavior
The
ReplacePagenavigation command should replace the current page with the page referenced in the CommandParameter attribute, leaving the navigation stack in-tact and retaining a back button.Actual Behavior
The
ReplacePagenavigation command appears to function exactly like theShowPagecommand - clearing out the navigation stack and showing the new page (at least within the context of an action panel).Screenshots or Videos
Reproduction XAML
{% assign targetPageGuid = '94071cfe-2df5-42d0-a267-1046f08ae6a8' %} <Button Text="Replace Page Test" Command="{Binding ShowActionPanel}" StyleClass="btn,btn-primary"> <Button.CommandParameter> <Rock:ShowActionPanelParameters Title="Choose a Command" CancelTitle="Dismiss"> <Rock:ActionPanelButton Title="Replace Page" Command="{Binding ReplacePage}" CommandParameter="{{ targetPageGuid }}" /> <Rock:ActionPanelButton Title="Show Page" Command="{Binding ShowPage}" CommandParameter="{{ targetPageGuid }}" /> </Rock:ShowActionPanelParameters> </Button.CommandParameter> </Button>Mobile Shell Version
6.0.0.0
Last Known Working Version
No response
iOS Device Type(s) and iOS Version(s)
iPhone 16 Pro, iOS 18.5 (22F76)
Android Device Type(s) and Android Version(s)
Google Pixel 7, Android 15