Skip to content

bug: ionTabsWillChange fires after tab has changed. #18900

Closed

Description

@masimplo

Bug Report

Ionic version:

[x] 4.x

Current behavior:

Calling a function on ionTabsWillChange event emission. Adding a breakpoint on that function is hit after the tab is changed. From the code it seams that ionTabsWillChange and ionTabsDidChange are fired together:

  onPageSelected(detail: StackEvent) {
    const stackId = detail.enteringView.stackId;
    if (detail.tabSwitch && stackId !== undefined) {
      if (this.tabBar) {
        this.tabBar.selectedTab = stackId;
      }
      this.ionTabsWillChange.emit({ tab: stackId });
      this.ionTabsDidChange.emit({ tab: stackId });
    }
  }

https://github.com/ionic-team/ionic/blob/6929bb817cff5e4ac3eb266e7aca45173c361789/angular/src/directives/navigation/ion-tabs.ts#L64

Expected behavior:

ionTabsWillChange should fire right before the tab is changed.

Steps to reproduce:

Related code:

insert short code snippets here

Other information:

Ionic info:

insert the output from ionic info here

Activity

  1. added
    package: angular
    type: bug
    on Oct 7, 2021
  2. averyrousseau commented on Mar 9, 2022

    @averyrousseau
    Contributor

    This has (at last!) been resolved via #24910, and the fix will be available in a future release of Ionic 👍

  3. ionitron-bot commented on Apr 8, 2022

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  4. locked and limited conversation to collaborators on Apr 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: angulartype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions