It would be awesome if there was an admin option to force chosen to search from the beginning of a string.

The jquery chosen module has a setting "enable_split_word_search" which we can disable to achieve this functionality.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jamesdixon’s picture

Status: Active » Needs review
FileSize
2.33 KB

Here is a patch we used to achieve this functionality. You can check "Searches from start of string only" from admin/config/user-interface/chosen, and the jquery chosen will be configured to search options from the beginning of the string only.

Den Tweed’s picture

Needed this functionality but patch didn't apply anymore so made a new one, only the changes in the js file were not needed anymore

Status: Needs review » Needs work

The last submitted patch, 2: search-beginning-string-2166799-2.patch, failed testing.

mr.york’s picture

Status: Needs work » Needs review
FileSize
1.77 KB

Reroll last patch.

Status: Needs review » Needs work

The last submitted patch, 4: search-beginning-string-2166799-4.patch, failed testing.

The last submitted patch, 4: search-beginning-string-2166799-4.patch, failed testing.

The last submitted patch, 4: search-beginning-string-2166799-4.patch, failed testing.

The last submitted patch, 4: search-beginning-string-2166799-4.patch, failed testing.

mr.york’s picture

Version: 7.x-2.x-dev » 8.x-2.x-dev
Status: Needs work » Needs review
FileSize
3.36 KB

Drupal 8 patch.

mr.york’s picture

Version: 8.x-2.x-dev » 7.x-2.x-dev

Status: Needs review » Needs work

The last submitted patch, 9: d8-search-beginning-string-2166799-9.patch, failed testing.

nagy.balint’s picture

I cant see any difference with this option on or off.
Can someone provide reproduction steps?