File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
core/src/components/select Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -188,8 +188,8 @@ export class Select implements ComponentInterface {
188
188
if ( this . disabled || this . isExpanded ) {
189
189
return undefined ;
190
190
}
191
- const overlay = ( this . overlay = await this . createOverlay ( event ) ) ;
192
191
this . isExpanded = true ;
192
+ const overlay = ( this . overlay = await this . createOverlay ( event ) ) ;
193
193
overlay . onDidDismiss ( ) . then ( ( ) => {
194
194
this . overlay = undefined ;
195
195
this . isExpanded = false ;
Original file line number Diff line number Diff line change
1
+ import { expect } from '@playwright/test' ;
2
+ import { test } from '@utils/test/playwright' ;
3
+
4
+ test . describe ( 'select: basic' , ( ) => {
5
+ test ( 'should not open multiple alert windows when clicked multiple times' , async ( { page } ) => {
6
+ test . info ( ) . annotations . push ( {
7
+ type : 'issue' ,
8
+ description : 'https://github.com/ionic-team/ionic-framework/issues/25126' ,
9
+ } ) ;
10
+
11
+ await page . goto ( '/src/components/select/test/basic' ) ;
12
+
13
+ const select = page . locator ( '#gender' ) ;
14
+
15
+ await select . evaluate ( ( el : HTMLSelectElement ) => {
16
+ /*
17
+ * Playwright's click() method attempts to scroll to the handle
18
+ * to perform the action. That is problematic when the overlay
19
+ * is already visible. We manually click() the element instead
20
+ * to avoid flaky tests.
21
+ */
22
+ el . click ( ) ;
23
+ el . click ( ) ;
24
+ el . click ( ) ;
25
+ } ) ;
26
+
27
+ const alerts = await page . $$ ( 'ion-alert' ) ;
28
+
29
+ expect ( alerts . length ) . toBe ( 1 ) ;
30
+ } ) ;
31
+ } ) ;
You can’t perform that action at this time.
0 commit comments