fix(refresher): refresher correctly detects native refresher when shown asynchronously (#22623)

resolves #22616
This commit is contained in:
Liam DeBeasi
2020-12-03 14:58:12 -05:00
committed by GitHub
parent 0be79fe82b
commit 5ed73cdf4d
2 changed files with 11 additions and 6 deletions

View File

@ -166,9 +166,14 @@ export const translateElement = (el?: HTMLElement, value?: string) => {
// Utils
// -----------------------------
export const shouldUseNativeRefresher = (referenceEl: HTMLIonRefresherElement, mode: string) => {
const pullingSpinner = referenceEl.querySelector('ion-refresher-content .refresher-pulling ion-spinner');
const refreshingSpinner = referenceEl.querySelector('ion-refresher-content .refresher-refreshing ion-spinner');
export const shouldUseNativeRefresher = async (referenceEl: HTMLIonRefresherElement, mode: string) => {
const refresherContent = referenceEl.querySelector('ion-refresher-content');
if (!refresherContent) { return Promise.resolve(false); }
await refresherContent.componentOnReady();
const pullingSpinner = refresherContent.querySelector('.refresher-pulling ion-spinner');
const refreshingSpinner = refresherContent.querySelector('.refresher-refreshing ion-spinner');
return (
pullingSpinner !== null &&