File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 22 class =" {{ classes.main }} "
33 style =" {{ styles.main }} "
44 tabindex =" {{ tabIndex }} " >
5- <div class =" sapWCSelectLabel" >
5+ <div
6+ class =" sapWCSelectLabel"
7+ @click =" {{ ctr._fnClickSelectBox }} " >
68 <ui5-label >{{ ctr._text }} </ui5-label >
79 </div >
810
2022 </ui5-popover >
2123 {{ /if }}
2224
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 {
1111import ShadowDOM from "@ui5/webcomponents-base/src/compatibility/ShadowDOM" ;
1212import KeyCodes from "@ui5/webcomponents-core/dist/sap/ui/events/KeyCodes" ;
1313import ValueState from "@ui5/webcomponents-base/src/types/ValueState" ;
14+ import Function from "@ui5/webcomponents-base/src/types/Function" ;
1415import Suggestions from "./Suggestions" ;
1516
1617// Template
@@ -94,6 +95,10 @@ const metadata = {
9495 type : Boolean ,
9596 defaultValue : false ,
9697 } ,
98+
99+ _fnClickSelectBox : {
100+ type : Function ,
101+ } ,
97102 } ,
98103 events : /** @lends sap.ui.webcomponents.main.Select.prototype */ {
99104 /**
@@ -156,20 +161,20 @@ class Select extends WebComponent {
156161 this . _setSelectedItem ( null ) ;
157162 this . _setPreviewedItem ( null ) ;
158163 this . Suggestions = new Suggestions ( this , "items" , true /* move focus with arrow keys */ ) ;
164+ this . _fnClickSelectBox = this . toggleList . bind ( this ) ;
159165 }
160166
161167 onBeforeRendering ( ) {
162168 this . _validateSelection ( ) ;
163169 }
164170
165171 /* Event handling */
166- onclick ( event ) {
172+ toggleList ( ) {
167173 if ( this . disabled ) {
168174 return ;
169175 }
170- if ( event . target === this ) {
171- this . Suggestions . toggle ( ) ;
172- }
176+
177+ this . Suggestions . toggle ( ) ;
173178 }
174179
175180 onkeydown ( event ) {
You can’t perform that action at this time.
0 commit comments