Skip to content

Commit c493620

Browse files
committed
Merge branch 'main' into cb/vue-ot-update
2 parents 5ce0fe2 + 68be8e9 commit c493620

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

.github/workflows/actions/test-core-screenshot/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
# which is why we not using the upload-archive
5050
# composite step here.
5151
run: |
52-
npm run test.e2e.docker.ci ${{ inputs.component }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots
52+
npm run test.e2e.docker.ci ${{ inputs.component }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots='changed'
5353
git add src/\*.png --force
5454
mkdir updated-screenshots
5555
cd ../ && rsync -R --progress $(git diff --name-only --cached) core/updated-screenshots

core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@
9393
"test": "npm run test.spec && npm run test.e2e",
9494
"test.spec": "stencil test --spec --max-workers=2",
9595
"test.e2e": "npx playwright test",
96-
"test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots",
96+
"test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots='changed'",
9797
"test.watch": "jest --watch --no-cache",
9898
"test.treeshake": "node scripts/treeshaking.js dist/index.js",
9999
"validate": "npm run lint && npm run test && npm run build && npm run test.treeshake",
100100
"docker.build": "docker build -t ionic-playwright .",
101101
"test.e2e.docker": "npm run docker.build && node ./scripts/docker.mjs",
102-
"test.e2e.docker.update-snapshots": "npm run test.e2e.docker -- --update-snapshots",
102+
"test.e2e.docker.update-snapshots": "npm run test.e2e.docker -- --update-snapshots='changed'",
103103
"test.e2e.docker.ci": "npm run docker.build && CI=true node ./scripts/docker.mjs",
104104
"test.e2e.script": "node scripts/testing/e2e-script.mjs"
105105
},

core/src/components/infinite-scroll/test/top/infinite-scroll.e2e.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { configs, test } from '@utils/test/playwright';
33

44
configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, config }) => {
55
test.describe(title('infinite-scroll: top'), () => {
6-
test('should load more items when scrolled to the top', async ({ page }) => {
6+
test('should load more items when scrolled to the top', async ({ page, skip }) => {
7+
// TODO(FW-6394): remove once flaky issue is resolved
8+
skip.browser('webkit', 'Safari is flaky on CI');
9+
710
await page.goto('/src/components/infinite-scroll/test/top', config);
811

912
const ionInfiniteComplete = await page.spyOnEvent('ionInfiniteComplete');

core/src/components/modal/gestures/sheet.ts

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,16 @@ export const createSheetGesture = (
264264

265265
const onMove = (detail: GestureDetail) => {
266266
/**
267-
* If `expandToScroll` is disabled, we should not allow the swipe gesture
268-
* to continue if the gesture is not pulling down.
267+
* If `expandToScroll` is disabled, and an upwards swipe gesture is done within
268+
* the scrollable content, we should not allow the swipe gesture to continue.
269269
*/
270270
if (!expandToScroll && detail.deltaY <= 0) {
271-
return;
271+
const contentEl = findClosestIonContent(detail.event.target! as HTMLElement);
272+
const scrollEl =
273+
contentEl && isIonContent(contentEl) ? getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl;
274+
if (scrollEl) {
275+
return;
276+
}
272277
}
273278

274279
/**
@@ -324,6 +329,19 @@ export const createSheetGesture = (
324329
};
325330

326331
const onEnd = (detail: GestureDetail) => {
332+
/**
333+
* If expandToScroll is disabled, we should not allow the moveSheetToBreakpoint
334+
* function to be called if the user is trying to swipe content upwards and the content
335+
* is not scrolled to the top.
336+
*/
337+
if (!expandToScroll && detail.deltaY <= 0 && findClosestIonContent(detail.event.target! as HTMLElement)) {
338+
const contentEl = findClosestIonContent(detail.event.target! as HTMLElement)!;
339+
const scrollEl = isIonContent(contentEl) ? getElementRoot(contentEl).querySelector('.inner-scroll') : contentEl;
340+
if (scrollEl!.scrollTop > 0) {
341+
return;
342+
}
343+
}
344+
327345
/**
328346
* When the gesture releases, we need to determine
329347
* the closest breakpoint to snap to.

0 commit comments

Comments
 (0)