-
Notifications
You must be signed in to change notification settings - Fork 13.4k
feat(item-sliding): add automatic full expand animation of items #31036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
6017570
994b969
a6f271f
63274c0
bd8568f
87ddc89
e0736dc
258e9df
0e9abb2
7762854
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -14,7 +14,8 @@ configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, conf | |||||
| await page.goto(`/src/components/item-sliding/test/basic`, config); | ||||||
| }); | ||||||
| test.describe('start options', () => { | ||||||
| test('should not have visual regressions', async ({ page }) => { | ||||||
| //TODO(FW-7184): remove skip once issue is resolved | ||||||
| test.skip('should not have visual regressions', async ({ page }) => { | ||||||
| const item = page.locator('#item2'); | ||||||
|
|
||||||
| /** | ||||||
|
|
@@ -108,7 +109,8 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co | |||||
| configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, config }) => { | ||||||
| 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 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| test.skip('should have padding on the left only', async ({ page }) => { | ||||||
| await page.setContent( | ||||||
| ` | ||||||
| <style> | ||||||
|
|
@@ -149,7 +151,8 @@ configs({ modes: ['ios', 'md', 'ionic-md'] }).forEach(({ title, screenshot, conf | |||||
| }); | ||||||
|
|
||||||
| test.describe('safe area right', () => { | ||||||
| test('should have padding on the right only', async ({ page }) => { | ||||||
| //TODO(FW-7184): remove skip once issue is resolved | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| test.skip('should have padding on the right only', async ({ page }) => { | ||||||
| await page.setContent( | ||||||
| ` | ||||||
| <style> | ||||||
|
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en" dir="ltr"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <title>Item Sliding - Full Swipe</title> | ||
| <meta | ||
| name="viewport" | ||
| content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover" | ||
| /> | ||
| <link href="../../../../../css/ionic.bundle.css" rel="stylesheet" /> | ||
| <link href="../../../../../scripts/testing/styles.css" rel="stylesheet" /> | ||
| <script src="../../../../../scripts/testing/scripts.js"></script> | ||
| <script nomodule src="../../../../../dist/ionic/ionic.js"></script> | ||
| <script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> | ||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-header> | ||
| <ion-toolbar> | ||
| <ion-title>Item Sliding - Full Swipe</ion-title> | ||
| </ion-toolbar> | ||
| </ion-header> | ||
|
|
||
| <ion-content> | ||
| <div class="ion-padding-start" style="padding-top: 30px"> | ||
| <ion-title>Full Swipe - Expandable Options</ion-title> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You shouldn't use <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 |
||
| </div> | ||
| <ion-list> | ||
| <!-- Expandable option on end side --> | ||
| <ion-item-sliding id="expandable-end"> | ||
| <ion-item> | ||
| <ion-label>Expandable End (Swipe Left)</ion-label> | ||
| </ion-item> | ||
| <ion-item-options side="end"> | ||
| <ion-item-option expandable="true" color="danger">Delete</ion-item-option> | ||
| </ion-item-options> | ||
| </ion-item-sliding> | ||
|
|
||
| <!-- Expandable on start side --> | ||
| <ion-item-sliding id="expandable-start"> | ||
| <ion-item> | ||
| <ion-label>Expandable Start (Swipe Right)</ion-label> | ||
| </ion-item> | ||
| <ion-item-options side="start"> | ||
| <ion-item-option expandable="true" color="success">Archive</ion-item-option> | ||
| </ion-item-options> | ||
| </ion-item-sliding> | ||
|
|
||
| <!-- Both sides with expandable --> | ||
| <ion-item-sliding id="expandable-both"> | ||
| <ion-item> | ||
| <ion-label>Expandable Both Sides</ion-label> | ||
| </ion-item> | ||
| <ion-item-options side="start"> | ||
| <ion-item-option expandable="true" color="success">Archive</ion-item-option> | ||
| </ion-item-options> | ||
| <ion-item-options side="end"> | ||
| <ion-item-option expandable="true" color="danger">Delete</ion-item-option> | ||
| </ion-item-options> | ||
| </ion-item-sliding> | ||
| </ion-list> | ||
|
|
||
| <div class="ion-padding-start" style="padding-top: 30px"> | ||
| <ion-title>Non-Expandable Options (No Full Swipe)</ion-title> | ||
| </div> | ||
| <ion-list> | ||
| <!-- Non-expandable option --> | ||
| <ion-item-sliding id="non-expandable"> | ||
| <ion-item> | ||
| <ion-label>Non-Expandable (Should Show Options)</ion-label> | ||
| </ion-item> | ||
| <ion-item-options side="end"> | ||
| <ion-item-option color="primary">Edit</ion-item-option> | ||
| </ion-item-options> | ||
| </ion-item-sliding> | ||
|
|
||
| <!-- Multiple non-expandable options --> | ||
| <ion-item-sliding id="non-expandable-multiple"> | ||
| <ion-item> | ||
| <ion-label>Multiple Non-Expandable Options</ion-label> | ||
| </ion-item> | ||
| <ion-item-options side="end"> | ||
| <ion-item-option color="primary">Edit</ion-item-option> | ||
| <ion-item-option color="secondary">Share</ion-item-option> | ||
| <ion-item-option color="danger">Delete</ion-item-option> | ||
| </ion-item-options> | ||
| </ion-item-sliding> | ||
| </ion-list> | ||
|
|
||
| <div class="ion-padding-start" style="padding-top: 30px"> | ||
| <ion-title>Mixed Scenarios</ion-title> | ||
| </div> | ||
| <ion-list> | ||
| <!-- Expandable with multiple options --> | ||
| <ion-item-sliding id="expandable-with-others"> | ||
| <ion-item> | ||
| <ion-label>Expandable + Other Options</ion-label> | ||
| </ion-item> | ||
| <ion-item-options side="end"> | ||
| <ion-item-option color="primary">Edit</ion-item-option> | ||
| <ion-item-option expandable="true" color="danger">Delete</ion-item-option> | ||
| </ion-item-options> | ||
| </ion-item-sliding> | ||
| </ion-list> | ||
| </ion-content> | ||
| </ion-app> | ||
| <script> | ||
| // Log swipe events for debugging | ||
| document.querySelectorAll('ion-item-sliding').forEach((item) => { | ||
| const id = item.getAttribute('id'); | ||
| item.querySelectorAll('ion-item-options').forEach((options) => { | ||
| options.addEventListener('ionSwipe', () => { | ||
| console.log(`[${id}] ionSwipe fired on ${options.getAttribute('side')} side`); | ||
| }); | ||
| }); | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.