mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
fix(ios): large title transition works properly in tabbed applications (#20555)
fixes #20482
This commit is contained in:
@ -13,11 +13,27 @@ export const shadow = <T extends Element>(el: T): ShadowRoot | T => {
|
||||
};
|
||||
|
||||
const getLargeTitle = (refEl: any) => {
|
||||
return refEl.querySelector('ion-header:not(.header-collapse-condense-inactive) ion-title[size=large]');
|
||||
const tabs = (refEl.tagName === 'ION-TABS') ? refEl : refEl.querySelector('ion-tabs');
|
||||
const query = 'ion-header:not(.header-collapse-condense-inactive) ion-title[size=large]';
|
||||
|
||||
if (tabs != null) {
|
||||
const activeTab = tabs.querySelector('ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)');
|
||||
return activeTab.querySelector(query);
|
||||
}
|
||||
|
||||
return refEl.querySelector(query);
|
||||
};
|
||||
|
||||
const getBackButton = (refEl: any, backDirection: boolean) => {
|
||||
const buttonsList = refEl.querySelectorAll('ion-buttons');
|
||||
const tabs = (refEl.tagName === 'ION-TABS') ? refEl : refEl.querySelector('ion-tabs');
|
||||
let buttonsList = [];
|
||||
|
||||
if (tabs != null) {
|
||||
const activeTab = tabs.querySelector('ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)');
|
||||
buttonsList = activeTab.querySelectorAll('ion-buttons');
|
||||
} else {
|
||||
buttonsList = refEl.querySelectorAll('ion-buttons');
|
||||
}
|
||||
|
||||
for (const buttons of buttonsList) {
|
||||
const parentHeader = buttons.closest('ion-header');
|
||||
@ -277,7 +293,6 @@ export const iosTransitionAnimation = (navEl: HTMLElement, opts: TransitionOptio
|
||||
const enteringContentHasLargeTitle = enteringEl.querySelector('ion-header.header-collapse-condense');
|
||||
|
||||
const { forward, backward } = createLargeTitleTransition(rootAnimation, isRTL, backDirection, enteringEl, leavingEl);
|
||||
|
||||
enteringToolBarEls.forEach(enteringToolBarEl => {
|
||||
const enteringToolBar = createAnimation();
|
||||
enteringToolBar.addElement(enteringToolBarEl);
|
||||
|
Reference in New Issue
Block a user