mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-17 10:41:13 +08:00
fix(ripple-effect): using method invocation instead of events
fixes #15318
This commit is contained in:
@ -109,11 +109,10 @@ export function startTapClick(doc: Document) {
|
||||
lastActivated = Date.now();
|
||||
el.classList.add(ACTIVATED);
|
||||
|
||||
const event = new CustomEvent('ionActivated', {
|
||||
bubbles: false,
|
||||
detail: { x, y }
|
||||
});
|
||||
el.dispatchEvent(event);
|
||||
const rippleEffect = getRippleEffect(el);
|
||||
if (rippleEffect && rippleEffect.addRipple) {
|
||||
rippleEffect.addRipple(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
function removeActivated(smooth: boolean) {
|
||||
@ -159,6 +158,16 @@ function getActivatableTarget(ev: any): any {
|
||||
}
|
||||
}
|
||||
|
||||
function getRippleEffect(el: HTMLElement) {
|
||||
if (el.shadowRoot) {
|
||||
const ripple = el.shadowRoot.querySelector('ion-ripple-effect');
|
||||
if (ripple) {
|
||||
return ripple;
|
||||
}
|
||||
}
|
||||
return el.querySelector('ion-ripple-effect');
|
||||
}
|
||||
|
||||
const ACTIVATED = 'activated';
|
||||
const ADD_ACTIVATED_DEFERS = 200;
|
||||
const CLEAR_STATE_DEFERS = 200;
|
||||
|
Reference in New Issue
Block a user