fix(refresher): add correct fallbacks for native refreshers (#20333)

This commit is contained in:
Liam DeBeasi
2020-01-29 15:36:09 -05:00
committed by GitHub
parent e580b88477
commit fd55427991
3 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { Component, ComponentInterface, Host, Prop, h } from '@stencil/core';
import { Component, ComponentInterface, Element, Host, Prop, h } from '@stencil/core';
import { config } from '../../global/config';
import { getIonMode } from '../../global/ionic-global';
@ -12,6 +12,8 @@ import { SPINNERS } from '../spinner/spinner-configs';
})
export class RefresherContent implements ComponentInterface {
@Element() el!: HTMLIonRefresherContentElement;
/**
* A static icon or a spinner to display when you begin to pull down.
* A spinner name can be provided to gradually show tick marks
@ -49,9 +51,10 @@ export class RefresherContent implements ComponentInterface {
componentWillLoad() {
if (this.pullingIcon === undefined) {
const mode = getIonMode(this);
const overflowRefresher = (this.el.style as any).webkitOverflowScrolling !== undefined ? 'lines' : 'arrow-down';
this.pullingIcon = config.get(
'refreshingIcon',
mode === 'ios' && isPlatform('mobile') ? config.get('spinner', 'lines') : 'circular'
mode === 'ios' && isPlatform('mobile') ? config.get('spinner', overflowRefresher) : 'circular'
);
}
if (this.refreshingSpinner === undefined) {

View File

@ -174,7 +174,7 @@ export const shouldUseNativeRefresher = (referenceEl: HTMLIonRefresherElement, m
pullingSpinner !== null &&
refreshingSpinner !== null &&
(
(mode === 'ios' && isPlatform('mobile')) ||
(mode === 'ios' && isPlatform('mobile') && (referenceEl.style as any).webkitOverflowScrolling !== undefined) ||
mode === 'md'
)

View File

@ -46,7 +46,7 @@ $z-index-click-block: 99999;
$z-index-fixed-content: 999;
$z-index-scroll-content: 1;
$z-index-refresher: -1;
$z-index-refresher: 0;
$z-index-page-container: 0;
$z-index-toolbar: 10;