mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(refresher): add correct fallbacks for native refreshers (#20333)
This commit is contained in:
@ -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 { config } from '../../global/config';
|
||||||
import { getIonMode } from '../../global/ionic-global';
|
import { getIonMode } from '../../global/ionic-global';
|
||||||
@ -12,6 +12,8 @@ import { SPINNERS } from '../spinner/spinner-configs';
|
|||||||
})
|
})
|
||||||
export class RefresherContent implements ComponentInterface {
|
export class RefresherContent implements ComponentInterface {
|
||||||
|
|
||||||
|
@Element() el!: HTMLIonRefresherContentElement;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A static icon or a spinner to display when you begin to pull down.
|
* 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
|
* A spinner name can be provided to gradually show tick marks
|
||||||
@ -49,9 +51,10 @@ export class RefresherContent implements ComponentInterface {
|
|||||||
componentWillLoad() {
|
componentWillLoad() {
|
||||||
if (this.pullingIcon === undefined) {
|
if (this.pullingIcon === undefined) {
|
||||||
const mode = getIonMode(this);
|
const mode = getIonMode(this);
|
||||||
|
const overflowRefresher = (this.el.style as any).webkitOverflowScrolling !== undefined ? 'lines' : 'arrow-down';
|
||||||
this.pullingIcon = config.get(
|
this.pullingIcon = config.get(
|
||||||
'refreshingIcon',
|
'refreshingIcon',
|
||||||
mode === 'ios' && isPlatform('mobile') ? config.get('spinner', 'lines') : 'circular'
|
mode === 'ios' && isPlatform('mobile') ? config.get('spinner', overflowRefresher) : 'circular'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (this.refreshingSpinner === undefined) {
|
if (this.refreshingSpinner === undefined) {
|
||||||
|
@ -174,7 +174,7 @@ export const shouldUseNativeRefresher = (referenceEl: HTMLIonRefresherElement, m
|
|||||||
pullingSpinner !== null &&
|
pullingSpinner !== null &&
|
||||||
refreshingSpinner !== null &&
|
refreshingSpinner !== null &&
|
||||||
(
|
(
|
||||||
(mode === 'ios' && isPlatform('mobile')) ||
|
(mode === 'ios' && isPlatform('mobile') && (referenceEl.style as any).webkitOverflowScrolling !== undefined) ||
|
||||||
mode === 'md'
|
mode === 'md'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ $z-index-click-block: 99999;
|
|||||||
|
|
||||||
$z-index-fixed-content: 999;
|
$z-index-fixed-content: 999;
|
||||||
$z-index-scroll-content: 1;
|
$z-index-scroll-content: 1;
|
||||||
$z-index-refresher: -1;
|
$z-index-refresher: 0;
|
||||||
|
|
||||||
$z-index-page-container: 0;
|
$z-index-page-container: 0;
|
||||||
$z-index-toolbar: 10;
|
$z-index-toolbar: 10;
|
||||||
|
Reference in New Issue
Block a user