fix(refresher): find parent ion-content properly

fixes #14833
This commit is contained in:
Manu Mtz.-Almeida
2018-07-24 00:42:14 +02:00
parent cb4acab198
commit 4eab209d18
2 changed files with 2 additions and 6 deletions

View File

@ -3947,6 +3947,7 @@ declare global {
* If true, the menu is disabled. Default `false`. * If true, the menu is disabled. Default `false`.
*/ */
'disabled': boolean; 'disabled': boolean;
'getWidth': () => number;
'isActive': () => boolean; 'isActive': () => boolean;
'isOpen': () => boolean; 'isOpen': () => boolean;
/** /**

View File

@ -98,12 +98,7 @@ export class Refresher {
console.error('Make sure you use: <ion-refresher slot="fixed">'); console.error('Make sure you use: <ion-refresher slot="fixed">');
return; return;
} }
const parentElement = this.el.parentElement; const contentEl = this.el.closest('ion-content');
if (!parentElement) {
console.error('ion-refresher is not attached');
return;
}
const contentEl = parentElement.querySelector('ion-content');
if (contentEl) { if (contentEl) {
await contentEl.componentOnReady(); await contentEl.componentOnReady();
this.scrollEl = contentEl.getScrollElement(); this.scrollEl = contentEl.getScrollElement();