File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change 25
25
font-weight : bold;
26
26
white-space : pre;
27
27
}
28
+ # testground {
29
+ visibility : hidden;
30
+ }
31
+ # testground .offscreen {
32
+ visibility : visible;
33
+ position : absolute;
34
+ left : -10000px ;
35
+ top : -10000px ;
36
+ }
28
37
.CodeMirror { border : 1px solid black; }
29
38
</ style >
30
39
</ head >
@@ -39,7 +48,7 @@ <h1>CodeMirror: Test Suite</h1>
39
48
< p id =status > Please enable JavaScript...</ p >
40
49
< div id =output > </ div >
41
50
42
- < div style =" visibility: hidden " id =testground > </ div >
51
+ < div id =testground > </ div >
43
52
44
53
< script src ="driver.js "> </ script >
45
54
< script src ="test.js "> </ script >
Original file line number Diff line number Diff line change @@ -971,6 +971,22 @@ testCM("lineWidgets", function(cm) {
971
971
eqPos ( cm . getCursor ( ) , { line : 1 , ch : 1 } ) ;
972
972
} ) ;
973
973
974
+ testCM ( "lineWidgetFocus" , function ( cm ) {
975
+ var place = document . getElementById ( "testground" ) ;
976
+ place . className = "offscreen" ;
977
+ try {
978
+ addDoc ( cm , 500 , 10 ) ;
979
+ var node = document . createElement ( "input" ) ;
980
+ var widget = cm . addLineWidget ( 1 , node ) ;
981
+ node . focus ( ) ;
982
+ eq ( document . activeElement , node ) ;
983
+ cm . replaceRange ( "new stuff" , { line : 1 , ch : 0 } ) ;
984
+ eq ( document . activeElement , node ) ;
985
+ } finally {
986
+ place . className = "" ;
987
+ }
988
+ } ) ;
989
+
974
990
testCM ( "getLineNumber" , function ( cm ) {
975
991
addDoc ( cm , 2 , 20 ) ;
976
992
var h1 = cm . getLineHandle ( 1 ) ;
You can’t perform that action at this time.
0 commit comments