Skip to content

Commit e6c0929

Browse files
committed
Merge remote-tracking branch 'origin/main' into sync-feature-7.4
2 parents 21b0731 + 63cb968 commit e6c0929

File tree

1,583 files changed

+781
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,583 files changed

+781
-601
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions

core/CHANGELOG.md

Lines changed: 11 additions & 0 deletions

core/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ionic/core",
3-
"version": "7.3.1",
3+
"version": "7.3.2",
44
"description": "Base components for Ionic",
55
"keywords": [
66
"ionic",

core/src/components/action-sheet/action-sheet.tsx

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Watch, Component, Element, Event, Host, Method, Prop, h, readTask } fro
33
import type { Gesture } from '@utils/gesture';
44
import { createButtonActiveGesture } from '@utils/gesture/button-active';
55
import { raf } from '@utils/helpers';
6+
import { createLockController } from '@utils/lock-controller';
67
import {
78
BACKDROP,
89
createDelegateController,
@@ -40,8 +41,8 @@ import { mdLeaveAnimation } from './animations/md.leave';
4041
})
4142
export class ActionSheet implements ComponentInterface, OverlayInterface {
4243
private readonly delegateController = createDelegateController(this);
44+
private readonly lockController = createLockController();
4345
private readonly triggerController = createTriggerController();
44-
private currentTransition?: Promise<any>;
4546
private wrapperEl?: HTMLElement;
4647
private groupEl?: HTMLElement;
4748
private gesture?: Gesture;
@@ -198,25 +199,13 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
198199
*/
199200
@Method()
200201
async present(): Promise<void> {
201-
/**
202-
* When using an inline action sheet
203-
* and dismissing a action sheet it is possible to
204-
* quickly present the action sheet while it is
205-
* dismissing. We need to await any current
206-
* transition to allow the dismiss to finish
207-
* before presenting again.
208-
*/
209-
if (this.currentTransition !== undefined) {
210-
await this.currentTransition;
211-
}
202+
const unlock = await this.lockController.lock();
212203

213204
await this.delegateController.attachViewToDom();
214205

215-
this.currentTransition = present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
206+
await present(this, 'actionSheetEnter', iosEnterAnimation, mdEnterAnimation);
216207

217-
await this.currentTransition;
218-
219-
this.currentTransition = undefined;
208+
unlock();
220209
}
221210

222211
/**
@@ -230,13 +219,16 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
230219
*/
231220
@Method()
232221
async dismiss(data?: any, role?: string): Promise<boolean> {
233-
this.currentTransition = dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
234-
const dismissed = await this.currentTransition;
222+
const unlock = await this.lockController.lock();
223+
224+
const dismissed = await dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation, mdLeaveAnimation);
235225

236226
if (dismissed) {
237227
this.delegateController.removeViewFromDom();
238228
}
239229

230+
unlock();
231+
240232
return dismissed;
241233
}
242234

core/src/components/alert/alert.tsx

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ENABLE_HTML_CONTENT_DEFAULT } from '@utils/config';
44
import type { Gesture } from '@utils/gesture';
55
import { createButtonActiveGesture } from '@utils/gesture/button-active';
66
import { raf } from '@utils/helpers';
7+
import { createLockController } from '@utils/lock-controller';
78
import {
89
createDelegateController,
910
createTriggerController,
@@ -46,6 +47,7 @@ import { mdLeaveAnimation } from './animations/md.leave';
4647
})
4748
export class Alert implements ComponentInterface, OverlayInterface {
4849
private readonly delegateController = createDelegateController(this);
50+
private readonly lockController = createLockController();
4951
private readonly triggerController = createTriggerController();
5052
private customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
5153
private activeId?: string;
@@ -54,7 +56,6 @@ export class Alert implements ComponentInterface, OverlayInterface {
5456
private processedButtons: AlertButton[] = [];
5557
private wrapperEl?: HTMLElement;
5658
private gesture?: Gesture;
57-
private currentTransition?: Promise<any>;
5859

5960
presented = false;
6061
lastFocus?: HTMLElement;
@@ -373,23 +374,13 @@ export class Alert implements ComponentInterface, OverlayInterface {
373374
*/
374375
@Method()
375376
async present(): Promise<void> {
376-
/**
377-
* When using an inline alert
378-
* and dismissing an alert it is possible to
379-
* quickly present the alert while it is
380-
* dismissing. We need to await any current
381-
* transition to allow the dismiss to finish
382-
* before presenting again.
383-
*/
384-
if (this.currentTransition !== undefined) {
385-
await this.currentTransition;
386-
}
377+
const unlock = await this.lockController.lock();
387378

388379
await this.delegateController.attachViewToDom();
389380

390-
this.currentTransition = present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
391-
await this.currentTransition;
392-
this.currentTransition = undefined;
381+
await present(this, 'alertEnter', iosEnterAnimation, mdEnterAnimation);
382+
383+
unlock();
393384
}
394385

395386
/**
@@ -403,13 +394,16 @@ export class Alert implements ComponentInterface, OverlayInterface {
403394
*/
404395
@Method()
405396
async dismiss(data?: any, role?: string): Promise<boolean> {
406-
this.currentTransition = dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
407-
const dismissed = await this.currentTransition;
397+
const unlock = await this.lockController.lock();
398+
399+
const dismissed = await dismiss(this, data, role, 'alertLeave', iosLeaveAnimation, mdLeaveAnimation);
408400

409401
if (dismissed) {
410402
this.delegateController.removeViewFromDom();
411403
}
412404

405+
unlock();
406+
413407
return dismissed;
414408
}
415409

core/src/components/checkbox/test/color/checkbox.e2e.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
1212
);
1313

1414
const checkbox = page.locator('ion-checkbox');
15-
expect(await checkbox.screenshot()).toMatchSnapshot(screenshot(`checkbox-color-checked`));
15+
await expect(checkbox).toHaveScreenshot(screenshot(`checkbox-color-checked`));
1616
});
1717

1818
test('should not apply color when unchecked', async ({ page }) => {
@@ -24,7 +24,7 @@ configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => {
2424
);
2525

2626
const checkbox = page.locator('ion-checkbox');
27-
expect(await checkbox.screenshot()).toMatchSnapshot(screenshot(`checkbox-color-unchecked`));
27+
await expect(checkbox).toHaveScreenshot(screenshot(`checkbox-color-unchecked`));
2828
});
2929
});
3030
});

0 commit comments

Comments
 (0)