[TitanOS] - onBeforeRouteLeave ignores return false. #13893
Unanswered
kauecastro
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The issue
Hello!
I'm Kauê Castro, Lead Engineer at Titan OS. Titan OS is an independent Operating System for Smart TVs and currently we're on Philips and JVC devices.
The problem: onBeforeRouteLeave does the navigation even returning false or calling next(false). Also, in the TV, there's something happening that if the action is a "router.back()", it somehow is understanding that there's no history and the result is to close the app (behavior that deviates from standard expectations in web routing contexts).
Use case: We're using it to display a confirmation modal when users click on back button. The problem is that the navigation is being done if I call next(false) in the onBeforeRouteLeave. For testing purposes, I put a return false directly in the onBeforeRouteLeave, but it still ignores that it should keep in the page.
Other TVs: I've tested it in other TV brands, such as Samsung and JVC and it works as expected (onBeforeRouteLeave blocks the navigation). Apparently there's something that makes this happen on Philips with Titan OS.
What we need from your side: We would like to check if it's a bug and how we can proceed to solve it. I've tried some other approaches, such as return nothing onBeforeRouteLeave and handle the "next" function in the "confirm button" callback, at first it seems to work, because doesn't view changes, but the route changes.
The following attachments are the video with the steps to reproduce and the code:
Steps to Reproduce
Expected Behavior
After clicking in cancel, it should remain at the "guarded" view route and keep the guarded view. If you click on confirm, it should go to the previous page.
Please, let me know if you need more details.
Beta Was this translation helpful? Give feedback.
All reactions