fix(header): do not error on collapsable header on devices that do not support IntersectionObserve (#21222)

This commit is contained in:
Liam DeBeasi
2020-05-08 11:57:50 -04:00
committed by GitHub
parent 9d0dcbbd31
commit 0c13f25bbb

View File

@ -87,6 +87,7 @@ export class Header implements ComponentInterface {
private async setupCollapsibleHeader(contentEl: HTMLIonContentElement | null, pageEl: Element | null) {
if (!contentEl || !pageEl) { console.error('ion-header requires a content to collapse, make sure there is an ion-content.'); return; }
if (typeof (IntersectionObserver as any) === 'undefined') { return; }
this.scrollEl = await contentEl.getScrollElement();