Skip to content

Commit

Permalink
fix(android): fix event from already active tab in bottom style TabGr…
Browse files Browse the repository at this point in the history
…oup (#11304)

Selecting an already active tab in a TabGroup with the bottom style navigation fires the selected
event for the tab. This does not match the default style.

Fixes TIMOB-27513
  • Loading branch information
ypbnv authored and sgtcoolguy committed Apr 17, 2020
1 parent 496e2b0 commit 5cd74a5
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -321,6 +321,11 @@ public boolean onMenuItemClick(MenuItem item)
{
// The controller has changed its selected item.
int index = this.mMenuItemsArray.indexOf(item);
// Guard for clicking on the currently selected tab.
// This is required to have parity with the default style tab.
if (index == this.currentlySelectedIndex) {
return true;
}
if ((index != currentlySelectedIndex) && (getProxy() != null)) {
if ((currentlySelectedIndex >= 0) && (currentlySelectedIndex < this.tabs.size())) {
TiViewProxy tabProxy = this.tabs.get(currentlySelectedIndex).getProxy();
Expand Down

0 comments on commit 5cd74a5

Please sign in to comment.