From c1e710a614470333b5ec0244cab514579136b388 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Mon, 24 Aug 2020 11:07:29 +0200 Subject: [PATCH] use replace when navigating with clearHistory --- packages/core/ui/frame/index.android.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/core/ui/frame/index.android.ts b/packages/core/ui/frame/index.android.ts index ef82d6743..6143a2416 100644 --- a/packages/core/ui/frame/index.android.ts +++ b/packages/core/ui/frame/index.android.ts @@ -439,7 +439,11 @@ export class Frame extends FrameBase { //transaction.setTransition(androidx.fragment.app.FragmentTransaction.TRANSIT_FRAGMENT_OPEN); } - transaction.add(this.containerViewId, newFragment, newFragmentTag); + if (clearHistory) { + transaction.replace(this.containerViewId, newFragment, newFragmentTag); + } else { + transaction.add(this.containerViewId, newFragment, newFragmentTag); + } transaction.commitAllowingStateLoss(); }