Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit 7113351

Browse files
authored
Merge pull request #183 from loonix/autocomplete-minlength
added option for user to select the length of autocomplete
2 parents 7515189 + c56aa53 commit 7113351

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app/modules/angular-slickgrid/editors/autoCompleteEditor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ export class AutoCompleteEditor implements Editor {
160160

161161
serializeValue() {
162162
// if user provided a custom structure, we will serialize the value returned from the object with custom structure
163+
const minLength = typeof this.editorOptions.minLength !== 'undefined' ? this.editorOptions.minLength : 3;
163164
if (this.editorOptions.forceUserInput) {
164-
this._currentValue = this.$input.val().length > 3 ? this.$input.val() : this._currentValue;
165+
this._currentValue = this.$input.val().length >= minLength ? this.$input.val() : this._currentValue;
165166
}
166167
if (this.customStructure && this._currentValue.hasOwnProperty(this.labelName)) {
167168
return this._currentValue[this.labelName];

0 commit comments

Comments
 (0)