File tree 2 files changed +18
-7
lines changed
2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 2
2
class =" {{ classes.main }} "
3
3
style =" {{ styles.main }} "
4
4
tabindex =" {{ tabIndex }} " >
5
- <div class =" sapWCSelectLabel" >
5
+ <div
6
+ class =" sapWCSelectLabel"
7
+ @click =" {{ ctr._fnClickSelectBox }} " >
6
8
<ui5-label >{{ ctr._text }} </ui5-label >
7
9
</div >
8
10
20
22
</ui5-popover >
21
23
{{ /if }}
22
24
23
- <ui5-icon src =" sap-icon://slim-arrow-down" class =" sapWCSelectDropDownIcon" ></ui5-icon >
24
- </div >
25
+ <ui5-icon
26
+ src =" sap-icon://slim-arrow-down"
27
+ class =" sapWCSelectDropDownIcon"
28
+ @press =" {{ ctr._fnClickSelectBox }} "
29
+ ></ui5-icon >
30
+ </div >
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
import ShadowDOM from "@ui5/webcomponents-base/src/compatibility/ShadowDOM" ;
12
12
import KeyCodes from "@ui5/webcomponents-core/dist/sap/ui/events/KeyCodes" ;
13
13
import ValueState from "@ui5/webcomponents-base/src/types/ValueState" ;
14
+ import Function from "@ui5/webcomponents-base/src/types/Function" ;
14
15
import Suggestions from "./Suggestions" ;
15
16
16
17
// Template
@@ -94,6 +95,10 @@ const metadata = {
94
95
type : Boolean ,
95
96
defaultValue : false ,
96
97
} ,
98
+
99
+ _fnClickSelectBox : {
100
+ type : Function ,
101
+ } ,
97
102
} ,
98
103
events : /** @lends sap.ui.webcomponents.main.Select.prototype */ {
99
104
/**
@@ -156,20 +161,20 @@ class Select extends WebComponent {
156
161
this . _setSelectedItem ( null ) ;
157
162
this . _setPreviewedItem ( null ) ;
158
163
this . Suggestions = new Suggestions ( this , "items" , true /* move focus with arrow keys */ ) ;
164
+ this . _fnClickSelectBox = this . toggleList . bind ( this ) ;
159
165
}
160
166
161
167
onBeforeRendering ( ) {
162
168
this . _validateSelection ( ) ;
163
169
}
164
170
165
171
/* Event handling */
166
- onclick ( event ) {
172
+ toggleList ( ) {
167
173
if ( this . disabled ) {
168
174
return ;
169
175
}
170
- if ( event . target === this ) {
171
- this . Suggestions . toggle ( ) ;
172
- }
176
+
177
+ this . Suggestions . toggle ( ) ;
173
178
}
174
179
175
180
onkeydown ( event ) {
You can’t perform that action at this time.
0 commit comments