feat(item-sliding): add automatic full expand animation of items#31036
feat(item-sliding): add automatic full expand animation of items#31036OS-pedrolourenco wants to merge 10 commits intonextfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
brandyscarney
left a comment
There was a problem hiding this comment.
The functionality is working well. 🎉 Requested some changes related to the tests!
|
|
||
| <ion-content> | ||
| <div class="ion-padding-start" style="padding-top: 30px"> | ||
| <ion-title>Full Swipe - Expandable Options</ion-title> |
There was a problem hiding this comment.
You shouldn't use ion-title outside of a toolbar, this is what's causing ios to look strange. Either use an h2 like this:
<h2>Full Swipe - Expandable Options</h2>
<style>
h2 {
font-size: 12px;
font-weight: normal;
color: #6f7378;
margin-top: 10px;
margin-left: 5px;
}
</style>Or use an ion-list-header at the top of the list.
| }); | ||
| test.describe('start options', () => { | ||
| test('should not have visual regressions', async ({ page }) => { | ||
| //TODO(FW-7184): remove skip once issue is resolved |
There was a problem hiding this comment.
| //TODO(FW-7184): remove skip once issue is resolved | |
| // TODO(FW-7184): remove skip once issue is resolved |
| test.describe(title('item-sliding: basic'), () => { | ||
| test.describe('safe area left', () => { | ||
| test('should have padding on the left only', async ({ page }) => { | ||
| //TODO(FW-7184): remove skip once issue is resolved |
There was a problem hiding this comment.
| //TODO(FW-7184): remove skip once issue is resolved | |
| // TODO(FW-7184): remove skip once issue is resolved |
|
|
||
| test.describe('safe area right', () => { | ||
| test('should have padding on the right only', async ({ page }) => { | ||
| //TODO(FW-7184): remove skip once issue is resolved |
There was a problem hiding this comment.
| //TODO(FW-7184): remove skip once issue is resolved | |
| // TODO(FW-7184): remove skip once issue is resolved |
| configs({ modes: ['ios', 'md', 'ionic-md'], directions: ['ltr'] }).forEach(({ title, config }) => { | ||
| test.describe(title('item-sliding: full swipe'), () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto(`/src/components/item-sliding/test/full-swipe`, config); |
There was a problem hiding this comment.
Can we break this into individual examples using page.setContent? Like this:
ionic-framework/core/src/components/avatar/test/shape/avatar.e2e.ts
Lines 10 to 36 in abe3b3f
| await dragElementBy(item, page, -190); | ||
| await page.waitForTimeout(FULL_ANIMATION_MS); | ||
|
|
||
| expect(ionSwipe.length).toBeGreaterThan(0); |
There was a problem hiding this comment.
| expect(ionSwipe.length).toBeGreaterThan(0); | |
| expect(ionSwipe.length).toBe(1); |
Can we check for exactly once?
| await dragElementBy(item, page, 190); | ||
| await page.waitForTimeout(FULL_ANIMATION_MS); | ||
|
|
||
| expect(ionSwipe.length).toBeGreaterThan(0); |
There was a problem hiding this comment.
| expect(ionSwipe.length).toBeGreaterThan(0); | |
| expect(ionSwipe.length).toBe(1); |
Can we check for exactly once?
| const item = page.locator('#expandable-end'); | ||
|
|
||
| // In RTL the "end" side is on the left, revealed by dragging right | ||
| const dragByX = config.direction === 'rtl' ? 190 : -190; |
There was a problem hiding this comment.
Why do we need a separate test for RTL? We should be able to use this on all the other tests.

Issue number: internal
What is the current behavior?
Dragging an ion-item with an expandable option would cause a full swipe event to be triggered but also cause the item to return to a position just after the item options once the mouse button was released.
What is the new behavior?
Does this introduce a breaking change?
Other information
Preview