mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(ripple-effect): add option to disable ripple-effect (#16393)
fixes #16379
This commit is contained in:
@@ -21,7 +21,7 @@ export class App implements ComponentInterface {
|
||||
const { win, config, queue } = this;
|
||||
|
||||
if (!config.getBoolean('_testing')) {
|
||||
importTapClick(win);
|
||||
importTapClick(win, config);
|
||||
}
|
||||
|
||||
importInputShims(win, config);
|
||||
@@ -54,8 +54,8 @@ function importStatusTap(win: Window, config: Config, queue: QueueApi) {
|
||||
}
|
||||
}
|
||||
|
||||
function importTapClick(win: Window) {
|
||||
import('../../utils/tap-click').then(module => module.startTapClick(win.document));
|
||||
function importTapClick(win: Window, config: Config) {
|
||||
import('../../utils/tap-click').then(module => module.startTapClick(win.document, config));
|
||||
}
|
||||
|
||||
function importInputShims(win: Window, config: Config) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { Component, ComponentInterface, Element, Method, Prop, QueueApi } from '@stencil/core';
|
||||
|
||||
import { Config } from '../../interface';
|
||||
|
||||
@Component({
|
||||
tag: 'ion-ripple-effect',
|
||||
styleUrl: 'ripple-effect.scss',
|
||||
@@ -13,20 +11,12 @@ export class RippleEffect implements ComponentInterface {
|
||||
|
||||
@Prop({ context: 'queue' }) queue!: QueueApi;
|
||||
@Prop({ context: 'window' }) win!: Window;
|
||||
@Prop({ context: 'config' }) config!: Config;
|
||||
|
||||
/**
|
||||
* Adds the ripple effect to the parent element
|
||||
*/
|
||||
@Method()
|
||||
async addRipple(pageX: number, pageY: number) {
|
||||
if (this.config.getBoolean('animated', true)) {
|
||||
return this.prepareRipple(pageX, pageY);
|
||||
}
|
||||
return () => { return; };
|
||||
}
|
||||
|
||||
private prepareRipple(pageX: number, pageY: number) {
|
||||
return new Promise<() => void>(resolve => {
|
||||
this.queue.read(() => {
|
||||
const rect = this.el.getBoundingClientRect();
|
||||
|
||||
Reference in New Issue
Block a user