Searchable select - Filter by starting letter


Topic: Searchable select - Filter by starting letter

fumarmata pro asked 1 year ago

Hello! I know how to make a searchable select box, but I want to find the options that start with the text that I'm typing, not that contain it. Is there a way? Or can point me to the specific JS that I should edit? Thanks!

Expected behavior

Filter options in select box if they start with a specific string

Actual behavior

Filter options in select box if they contain a specific string

Resources (screenshots, code snippets etc.) https://mdbootstrap.com/snippets/jquery/fumarmata/2993119

<select class="mdb-select md-form" searchable="Search here..">
  <option value="" disabled selected>Choose your country</option>
  <option value="1">USA</option>
  <option value="2">Germany</option>
  <option value="3">France</option>
  <option value="3">Poland</option>
  <option value="3">Japan</option>
</select>

Marcin Luczak staff answered 1 year ago

Hi,

The described functionality of the component is not included in our specification. At the moment, we do not plan to expand the capabilities of the component so as not to degrade its stability.

If you would like to try to change it on your own you should seek for bindSearchInputKeyup function inside material-select-view.js in your src/js/pro directory. Please remember that you should bundle your code on your own after the change, or manually add changed material-select to your index.html file, but we cannot guarantee its stability after that.

Keep coding,

Marcin


Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.19.2
  • Device: All
  • Browser: All
  • OS: All
  • Provided sample code: No
  • Provided link: Yes