mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
fix(tap-click): instant activate does not use a setTimeout (#26748)
This commit is contained in:
@ -91,12 +91,17 @@ export const startTapClick = (config: Config) => {
|
|||||||
clearDefers.delete(el);
|
clearDefers.delete(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
const delay = isInstant(el) ? 0 : ADD_ACTIVATED_DEFERS;
|
|
||||||
el.classList.remove(ACTIVATED);
|
el.classList.remove(ACTIVATED);
|
||||||
activeDefer = setTimeout(() => {
|
const callback = () => {
|
||||||
addActivated(el, x, y);
|
addActivated(el, x, y);
|
||||||
activeDefer = undefined;
|
activeDefer = undefined;
|
||||||
}, delay);
|
};
|
||||||
|
|
||||||
|
if (isInstant(el)) {
|
||||||
|
callback();
|
||||||
|
} else {
|
||||||
|
activeDefer = setTimeout(callback, ADD_ACTIVATED_DEFERS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
activatableEle = el;
|
activatableEle = el;
|
||||||
};
|
};
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { expect } from '@playwright/test';
|
import { expect } from '@playwright/test';
|
||||||
import { test } from '@utils/test/playwright';
|
import { test } from '@utils/test/playwright';
|
||||||
|
|
||||||
// TODO FW-3010
|
test.describe('tap click utility', () => {
|
||||||
test.describe.skip('tap click utility', () => {
|
|
||||||
test.beforeEach(({ skip }) => {
|
test.beforeEach(({ skip }) => {
|
||||||
skip.rtl();
|
skip.rtl();
|
||||||
skip.mode('ios');
|
skip.mode('ios');
|
||||||
@ -10,7 +9,7 @@ test.describe.skip('tap click utility', () => {
|
|||||||
test('it should apply activated class when clicking element', async ({ page }) => {
|
test('it should apply activated class when clicking element', async ({ page }) => {
|
||||||
await page.setContent(`
|
await page.setContent(`
|
||||||
<ion-app>
|
<ion-app>
|
||||||
<button class="ion-activatable">Click Me</button>
|
<button class="ion-activatable ion-activatable-instant">Click Me</button>
|
||||||
</ion-app>
|
</ion-app>
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user