-
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(select): Account for when options are not loaded immediately (#17405
) * Added logging to begin debugging issue * identify potential fix, add test * fix(select): render when options are loaded after a delay * fix linter issues * fix e2e test * fix edge case with if statement
- Loading branch information
1 parent
f832de5
commit 1c9c18b
Showing
3 changed files
with
60 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { newE2EPage } from '@stencil/core/testing'; | ||
|
||
test('select: async', async () => { | ||
const page = await newE2EPage({ | ||
url: '/src/components/select/test/async?ionic:_testing=true' | ||
}); | ||
|
||
const compare = await page.compareScreenshot(); | ||
expect(compare).toMatchScreenshot(); | ||
}); |
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,37 @@ | ||
<!DOCTYPE html> | ||
<html dir="ltr"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Select - Async</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/core.css" rel="stylesheet"> | ||
<link href="../../../../../scripts/testing/styles.css" rel="stylesheet"> | ||
<script src="../../../../../scripts/testing/scripts.js"></script> | ||
<script src="../../../../../dist/ionic.js"></script> | ||
</head> | ||
|
||
<body> | ||
<ion-select id="animals" placeholder="Select One"></ion-select> | ||
|
||
<script> | ||
let select = document.getElementById('animals'); | ||
const options = ['bird', 'dog', 'shark', 'lizard']; | ||
|
||
setTimeout(() => { | ||
|
||
options.forEach(option => { | ||
let o = document.createElement('ion-select-option'); | ||
o.value = option; | ||
o.textContent = option; | ||
|
||
select.appendChild(o); | ||
}); | ||
|
||
select.value = options[0]; | ||
|
||
}, 500); | ||
|
||
</script> | ||
</body> | ||
</html> |