File tree Expand file tree Collapse file tree
visualpython/js/com/component Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ define([
1717 this . _placeholder = "Select variable" ;
1818 this . _compID = "" ;
1919 this . _additionalClass = "" ;
20+ this . _autoFocus = true ;
2021 this . _normalFilter = true ;
2122 this . _suggestList = new Array ( ) ;
2223 this . _selectEvent = undefined ;
@@ -48,6 +49,13 @@ define([
4849 setComponentID ( compID = "" ) {
4950 this . _compID = compID ;
5051 }
52+ /**
53+ * set auto focus on enter
54+ * @param {boolean } autoFocus
55+ */
56+ setAutoFocus ( autoFocus = true ) {
57+ this . _autoFocus = autoFocus ;
58+ }
5159 /**
5260 * normal filter usage
5361 * @param {String } normalFilter
@@ -118,7 +126,7 @@ define([
118126 $ ( com_util . formatString ( ".{0}" , that . uuid ) ) . removeClass ( 'suggest-input-uninit' ) . addClass ( 'suggest-input' ) ;
119127
120128 $ ( com_util . formatString ( ".{0}" , that . uuid ) ) . autocomplete ( {
121- autoFocus : true ,
129+ autoFocus : that . _autoFocus ,
122130 minLength : minLength ,
123131 source : function ( req , res ) {
124132 var srcList = typeof that . _suggestList == "function" ? that . _suggestList ( ) : that . _suggestList ;
You can’t perform that action at this time.
0 commit comments