Skip to content

Commit

Permalink
fix(header): large title transition works on older versions of iOS (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidStrausz authored May 27, 2020
1 parent 7703da2 commit 2dac12c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions core/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ export class Header implements ComponentInterface {
const pageEl = this.el.closest('ion-app,ion-page,.ion-page,page-inner');
const contentEl = (pageEl) ? pageEl.querySelector('ion-content') : null;

// Cloned elements are always needed in iOS transition
writeTask(() => {
const title = cloneElement('ion-title') as HTMLIonTitleElement;
title.size = 'large';
cloneElement('ion-back-button');
});

await this.setupCollapsibleHeader(contentEl, pageEl);
}
}
Expand Down Expand Up @@ -127,10 +134,6 @@ export class Header implements ComponentInterface {
this.scrollEl!.addEventListener('scroll', this.contentScrollCallback);

writeTask(() => {
const title = cloneElement('ion-title') as HTMLIonTitleElement;
title.size = 'large';
cloneElement('ion-back-button');

if (this.collapsibleMainHeader !== undefined) {
this.collapsibleMainHeader.classList.add('header-collapse-main');
}
Expand Down

0 comments on commit 2dac12c

Please sign in to comment.