Skip to content

Commit d0d7eb6

Browse files
author
minjk-bl
committed
Edit SuggestInput to select autofocus
1 parent 2607504 commit d0d7eb6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

visualpython/js/com/component/SuggestInput.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)