File tree 1 file changed +9
-1
lines changed
visualpython/js/com/component 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ define([
17
17
this . _placeholder = "Select variable" ;
18
18
this . _compID = "" ;
19
19
this . _additionalClass = "" ;
20
+ this . _autoFocus = true ;
20
21
this . _normalFilter = true ;
21
22
this . _suggestList = new Array ( ) ;
22
23
this . _selectEvent = undefined ;
@@ -48,6 +49,13 @@ define([
48
49
setComponentID ( compID = "" ) {
49
50
this . _compID = compID ;
50
51
}
52
+ /**
53
+ * set auto focus on enter
54
+ * @param {boolean } autoFocus
55
+ */
56
+ setAutoFocus ( autoFocus = true ) {
57
+ this . _autoFocus = autoFocus ;
58
+ }
51
59
/**
52
60
* normal filter usage
53
61
* @param {String } normalFilter
@@ -118,7 +126,7 @@ define([
118
126
$ ( com_util . formatString ( ".{0}" , that . uuid ) ) . removeClass ( 'suggest-input-uninit' ) . addClass ( 'suggest-input' ) ;
119
127
120
128
$ ( com_util . formatString ( ".{0}" , that . uuid ) ) . autocomplete ( {
121
- autoFocus : true ,
129
+ autoFocus : that . _autoFocus ,
122
130
minLength : minLength ,
123
131
source : function ( req , res ) {
124
132
var srcList = typeof that . _suggestList == "function" ? that . _suggestList ( ) : that . _suggestList ;
You can’t perform that action at this time.
0 commit comments