Skip to content

Commit 6e6767d

Browse files
authored
Revert "Pop to root when tapping on active bottom tab on Android (#7239)"
This reverts commit bb2b09e.
1 parent e19ff8c commit 6e6767d

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/bottomtabs/BottomTabsController.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@
1515
import com.reactnativenavigation.options.BottomTabOptions;
1616
import com.reactnativenavigation.options.Options;
1717
import com.reactnativenavigation.react.CommandListener;
18-
import com.reactnativenavigation.react.CommandListenerAdapter;
1918
import com.reactnativenavigation.react.events.EventEmitter;
2019
import com.reactnativenavigation.utils.ImageLoader;
2120
import com.reactnativenavigation.viewcontrollers.bottomtabs.attacher.BottomTabsAttacher;
2221
import com.reactnativenavigation.viewcontrollers.child.ChildControllersRegistry;
2322
import com.reactnativenavigation.viewcontrollers.parent.ParentController;
24-
import com.reactnativenavigation.viewcontrollers.stack.StackController;
2523
import com.reactnativenavigation.viewcontrollers.viewcontroller.Presenter;
2624
import com.reactnativenavigation.viewcontrollers.viewcontroller.ViewController;
2725
import com.reactnativenavigation.views.bottomtabs.BottomTabs;
@@ -171,22 +169,15 @@ public ViewController<?> getCurrentChild() {
171169

172170
@Override
173171
public boolean onTabSelected(int index, boolean wasSelected) {
174-
ViewController<?> stack = tabs.get(index);
175-
BottomTabOptions options = stack.resolveCurrentOptions().bottomTabOptions;
172+
BottomTabOptions options = tabs.get(index).resolveCurrentOptions().bottomTabOptions;
176173

177174
eventEmitter.emitBottomTabPressed(index);
178175

179176
if (options.selectTabOnPress.get(true)) {
180177
eventEmitter.emitBottomTabSelected(bottomTabs.getCurrentItem(), index);
181-
if (!wasSelected) {
182-
selectTab(index);
183-
}
178+
if (wasSelected) return false;
179+
selectTab(index);
184180
}
185-
186-
if (wasSelected && stack instanceof StackController) {
187-
((StackController) stack).popToRoot(Options.EMPTY, new CommandListenerAdapter());
188-
}
189-
190181
return false;
191182
}
192183

0 commit comments

Comments
 (0)