mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 09:34:19 +08:00
fix(react): correctly show ion-back-button when going back (#23069)
resolves #22692
This commit is contained in:
@ -194,7 +194,7 @@ export class StackManager extends React.PureComponent<StackManagerProps, StackMa
|
|||||||
deepWait: true,
|
deepWait: true,
|
||||||
duration: direction === undefined ? 0 : undefined,
|
duration: direction === undefined ? 0 : undefined,
|
||||||
direction: direction as any,
|
direction: direction as any,
|
||||||
showGoBack: direction === 'forward',
|
showGoBack: !!routeInfo.pushedByRoute,
|
||||||
progressAnimation: false,
|
progressAnimation: false,
|
||||||
animationBuilder: routeInfo.routeAnimation,
|
animationBuilder: routeInfo.routeAnimation,
|
||||||
});
|
});
|
||||||
|
@ -289,6 +289,27 @@ describe('Routing Tests', () => {
|
|||||||
cy.ionPageVisible('home-page');
|
cy.ionPageVisible('home-page');
|
||||||
cy.ionPageHidden('favorites-page');
|
cy.ionPageHidden('favorites-page');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should show back button when going back to a pushed page', () => {
|
||||||
|
cy.visit(`http://localhost:${port}/routing/tabs/home`);
|
||||||
|
|
||||||
|
cy.ionNav('ion-item', 'Details 1');
|
||||||
|
cy.ionPageHidden('home-page');
|
||||||
|
cy.ionPageVisible('home-details-page-1');
|
||||||
|
|
||||||
|
cy.get('ion-tab-button#tab-button-settings').click();
|
||||||
|
cy.ionPageHidden('home-details-page-1');
|
||||||
|
cy.ionPageVisible('settings-page');
|
||||||
|
|
||||||
|
cy.get('ion-tab-button#tab-button-home').click();
|
||||||
|
cy.ionPageHidden('settings-page');
|
||||||
|
cy.ionPageVisible('home-details-page-1');
|
||||||
|
|
||||||
|
cy.ionBackClick('home-details-page-1');
|
||||||
|
|
||||||
|
cy.ionPageDoesNotExist('home-details-page-1');
|
||||||
|
cy.ionPageVisible('home-page');
|
||||||
|
});
|
||||||
/*
|
/*
|
||||||
Tests to add:
|
Tests to add:
|
||||||
Test that lifecycle events fire
|
Test that lifecycle events fire
|
||||||
|
@ -37,7 +37,7 @@ const Details: React.FC<DetailsProps> = () => {
|
|||||||
<IonHeader>
|
<IonHeader>
|
||||||
<IonToolbar>
|
<IonToolbar>
|
||||||
<IonButtons>
|
<IonButtons>
|
||||||
<IonBackButton defaultHref="/routing/tabs/home"></IonBackButton>
|
<IonBackButton></IonBackButton>
|
||||||
</IonButtons>
|
</IonButtons>
|
||||||
<IonTitle>Details</IonTitle>
|
<IonTitle>Details</IonTitle>
|
||||||
</IonToolbar>
|
</IonToolbar>
|
||||||
|
Reference in New Issue
Block a user