File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 2323 aria-describedby =" {{ valueStateTextId }} "
2424 aria-label =" {{ ariaLabelText }} "
2525 aria-required =" {{ required }} "
26+ data-sap-focus-ref
2627 />
2728
2829 {{ #if icon }}
Original file line number Diff line number Diff line change 5454 < ui5-cb-item text ="Canada "> </ ui5-cb-item >
5555 < ui5-cb-item text ="Chile "> </ ui5-cb-item >
5656 </ ui5-combobox >
57+ < ui5-button id ="combo-focus "> Focus ComboBox</ ui5-button >
5758
5859 < br >
5960
@@ -276,6 +277,10 @@ <h3>ComboBox in Compact</h3>
276277 document . getElementById ( "value-set-btn" ) . addEventListener ( "click" , function ( event ) {
277278 document . getElementById ( "combo" ) . value = "new value" ;
278279 } ) ;
280+
281+ document . getElementById ( "combo-focus" ) . addEventListener ( "click" , function ( ) {
282+ document . getElementById ( "combo" ) . focus ( ) ;
283+ } ) ;
279284 </ script >
280285
281286</ body >
Original file line number Diff line number Diff line change @@ -491,4 +491,15 @@ describe("Accessibility", () => {
491491 assert . strictEqual ( combo . getProperty ( "value" ) , "new value" , "ComboBox value should be set to 'new value'" ) ;
492492 assert . strictEqual ( inner . getProperty ( "value" ) , "new value" , "ComboBox value should be set to 'new value'" ) ;
493493 } ) ;
494+
495+ it ( "Should focus the ComboBox with the API" , ( ) => {
496+ browser . url ( `http://localhost:${ PORT } /test-resources/pages/ComboBox.html` ) ;
497+
498+ const combo = $ ( "#combo" ) ;
499+ const focusBtn = $ ( "#combo-focus" ) ;
500+
501+ focusBtn . click ( ) ;
502+
503+ assert . ok ( combo . getProperty ( "focused" ) , "ComboBox to be focused" ) ;
504+ } ) ;
494505} ) ;
You can’t perform that action at this time.
0 commit comments