2

Building an application that should run on both lightning experience and mobile Saleforce with the following component structure

mainMenu component -> search Component(s) -> custom record view

Have been trying to do use the lightning:navigation via the document here. https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/components_navigation.htm

On both iOS and Android using the lightning:navigation the back functionality doesn't work correctly:

  1. Navigating to a new component does NOT update the hamburger menu to a back arrow on either device.
  2. On Android devices using the device back button results in being redirected to home/last page before app was loaded.
  3. On iOS without a back button the users are stranded on the newly loaded component with no way to go back.
  4. This solution introduces mobile devices being unable to scroll child component content when child component is larger than parent https://success.salesforce.com/issues_view?id=a1p3A0000008fdDQAQ

Does anyone know how to get the back button to function correctly? Appears to be a bug or serious lacking feature. This limitation seems to require a custom button to return to parent component and I believe this should be handled by the hamburger/back arrow interface.

Using the previous force:navigateToComponent:

  1. Navigating to a new component successfully updated the hamburger to a back arrow on iOS and successfully took you back to previous component.
  2. On Android the back button wasn't rendered but selecting the device back button correctly sends you to the parent component.
  3. this solution introduces mobile devices being unable to scroll child component content when child component is larger than parent https://success.salesforce.com/issues_view?id=a1p3A0000008fdDQAQ

Attempting to swap components by dynamically creating and destroying results in the back button not being effected on the mobile application. This solution would also require a custom button to return to the parent component ( not the hamburger back button). Appears that this is the only viable solution and that mobile apps at this point cannot correctly us the navigation methods provided. This doesn't feel correct..

1
  • Additional bug when using the lightning:navigation on the lightning experience desktop does not respect the navigation and the back button and returns the user to the home/last page from the navigated to child component. Jul 20, 2018 at 18:10

1 Answer 1

0

According to salesforce documentation when you use lightning:isUrlAddressable interface the target of a navigation action maps to the same component, the routing container might simply update the pageReference attribute value instead of recreating the component. In this scenario, a change handler ensures that your component reacts correctly.

https://developer.salesforce.com/docs/component-library/bundle/lightning:isUrlAddressable/documentation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .