File tree 2 files changed +33
-1
lines changed
2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -489,6 +489,8 @@ class ComboBox extends UI5Element {
489
489
this . fireEvent ( "change" ) ;
490
490
this . inner . setSelectionRange ( this . value . length , this . value . length ) ;
491
491
}
492
+
493
+ this . _closeRespPopover ( ) ;
492
494
}
493
495
494
496
_selectItem ( event ) {
@@ -504,7 +506,6 @@ class ComboBox extends UI5Element {
504
506
} ) ;
505
507
506
508
this . _inputChange ( ) ;
507
- this . _closeRespPopover ( ) ;
508
509
}
509
510
510
511
get _headerTitleText ( ) {
Original file line number Diff line number Diff line change @@ -112,6 +112,37 @@ describe("General interaction", () => {
112
112
assert . notOk ( popover . getProperty ( "opened" ) , "Popover should close" ) ;
113
113
} ) ;
114
114
115
+ it ( "Should close popover on item click / change event" , ( ) => {
116
+ browser . url ( "http://localhost:8080/test-resources/pages/ComboBox.html" ) ;
117
+
118
+ const combo = $ ( "#combo2" ) ;
119
+ const arrow = combo . shadow$ ( "[input-icon]" ) ;
120
+ const input = combo . shadow$ ( "#ui5-combobox-input" ) ;
121
+ const staticAreaItemClassName = browser . getStaticAreaItemClassName ( "#combo2" ) ;
122
+ const popover = browser . $ ( `.${ staticAreaItemClassName } ` ) . shadow$ ( "ui5-responsive-popover" ) ;
123
+ let listItems = popover . $ ( "ui5-list" ) . $$ ( "ui5-li" ) ;
124
+
125
+ // act
126
+ input . click ( ) ;
127
+ input . keys ( "b" ) ;
128
+
129
+ // assert
130
+ assert . ok ( popover . getProperty ( "opened" ) , "Popover should be opened" ) ;
131
+
132
+ // act
133
+ input . keys ( "Enter" ) ;
134
+
135
+ // assert
136
+ assert . notOk ( popover . getProperty ( "opened" ) , "Popover should be closed" ) ;
137
+
138
+ // act
139
+ arrow . click ( ) ;
140
+ listItems [ 0 ] . click ( ) ;
141
+
142
+ // assert
143
+ assert . notOk ( popover . getProperty ( "opened" ) , "Popover should be closed" ) ;
144
+ } ) ;
145
+
115
146
it ( "Tests change event" , ( ) => {
116
147
const dummyTarget = $ ( "#combo" ) ;
117
148
const placeholder = $ ( "#change-placeholder" ) ;
You can’t perform that action at this time.
0 commit comments