File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,19 @@ QUnit.module('typesense-minibar', hooks => {
469
469
) ;
470
470
} ) ;
471
471
472
+ QUnit . test ( 'focus [data-slash=false]' , async assert => {
473
+ const form = parseHTML ( '<form data-slash="false"><input type="search"></form>' ) ;
474
+ document . body . append ( form ) ;
475
+ assert . false ( form . contains ( document . activeElement || null ) , 'initial focus' ) ;
476
+
477
+ bar = tsminibar ( form ) ;
478
+ assert . false ( form . contains ( document . activeElement || null ) , 'focus after contruct' ) ;
479
+
480
+ // should be ignored when data-slash=false
481
+ simulate ( document , 'keydown' , { } , { key : '/' } ) ;
482
+ assert . false ( form . contains ( document . activeElement || null ) , 'focus after slash' ) ;
483
+ } ) ;
484
+
472
485
QUnit . test ( 'focus [slash]' , async assert => {
473
486
const form = parseHTML ( '<form><input type="search"></form>' ) ;
474
487
const input = form . firstChild ;
You can’t perform that action at this time.
0 commit comments