-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ios): swipe to go back now works in rtl mode (#24866)
resolves #19488
- Loading branch information
1 parent
331ce6d
commit 2ac9105
Showing
6 changed files
with
179 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
import { dragElementBy } from '@utils/test'; | ||
|
||
test('swipe to go back should complete', async () => { | ||
const page = await newE2EPage({ url: '/src/utils/gesture/test?ionic:mode=ios' }); | ||
|
||
const nav = await page.find('ion-nav'); | ||
const ionNavDidChange = await nav.spyOnEvent('ionNavDidChange'); | ||
|
||
await page.click('.next'); | ||
await ionNavDidChange.next(); | ||
|
||
const content = await page.$('.page-two-content'); | ||
|
||
const width = await page.evaluate(() => window.innerWidth); | ||
await dragElementBy(content, page, width, 0, { x: 25, y: 100 }); | ||
|
||
await ionNavDidChange.next(); | ||
}); | ||
|
||
test('swipe to go back should complete in rtl', async () => { | ||
const page = await newE2EPage({ url: '/src/utils/gesture/test?rtl=true&ionic:mode=ios' }); | ||
|
||
const nav = await page.find('ion-nav'); | ||
const ionNavDidChange = await nav.spyOnEvent('ionNavDidChange'); | ||
|
||
await page.click('.next'); | ||
await ionNavDidChange.next(); | ||
|
||
const width = await page.evaluate(() => window.innerWidth); | ||
|
||
const content = await page.$('.page-two-content'); | ||
await dragElementBy(content, page, -width, 0, { x: width - 25, y: 100 }); | ||
|
||
await ionNavDidChange.next(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Swipe to go back</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
<link href="../../../../../css/ionic.bundle.css" rel="stylesheet"> | ||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet"> | ||
<script src="../../../../../scripts/testing/scripts.js"></script> | ||
<script type="module" src="../../../../../dist/ionic/ionic.esm.js"></script> | ||
<script> | ||
class PageOne extends HTMLElement { | ||
connectedCallback() { | ||
this.innerHTML = ` | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title>Page One</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content class="ion-padding"> | ||
<h1>Page One</h1> | ||
<ion-nav-link router-direction="forward" component="page-two"> | ||
<ion-button class="next">Go to Page Two</ion-button> | ||
</ion-nav-link> | ||
</ion-content> | ||
`; | ||
} | ||
} | ||
class PageTwo extends HTMLElement { | ||
connectedCallback() { | ||
this.innerHTML = ` | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-buttons slot="start"> | ||
<ion-back-button></ion-back-button> | ||
</ion-buttons> | ||
<ion-title>Page Two</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content class="page-two-content ion-padding"> | ||
<h1>Page Two</h1> | ||
</ion-content> | ||
`; | ||
} | ||
} | ||
customElements.define('page-one', PageOne); | ||
customElements.define('page-two', PageTwo); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<ion-app> | ||
<ion-nav root="page-one"></ion-nav> | ||
</ion-app> | ||
|
||
<script> | ||
window.Ionic = { | ||
config: { | ||
mode: 'ios' | ||
} | ||
} | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters