Topic: MDB auto-completer & minSearchLength

amineware pro asked 5 years ago


Previously until MDB Angular 7.2.0 we used mdb-autocomplete and it has an input called "minSearchLength". Now as it's recommended to migrate to mdb-auto-completer do you have plans to implement a "minSearchLength" option ? We looked in the source code / docs and didn't found such an option for the new component. Thanks.


Damian Gemza staff answered 5 years ago


Dear amineware,

There's no [minSearchLength] input in the new mdb-auto-completer code because all the search logic are provided by the user - you can write it on your own (i mean call search function when search text is longer than some size).

Please take a look at the modified getFilteredData() method which starts searching, if searchText is longer than 2 signs:

getFilteredData() {
    if (this.searchText.length > 2) {
      this.results = this.searchEntries(this.searchText);
    } else {
      this.results = this.searchEntries('');
    }
  }

Best Regards,

Damian



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.4.2
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: No