Disable searchResultLimit
by default
#1315
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
I got confused when using some of the default settings of Choices.js plus
searchEnabled: true
that I could not find entries via the search in larger selects, unless I typed in more letters of the entry that I was looking for. So for example if I typed the letter a, it did not show all entries with that letter.The reason for this is that the default
searchResultLimit
is set to 4:Choices/src/scripts/defaults.ts
Line 60 in 8c0c11e
However, this does not make much sense to me as by default the
renderChoiceLimit
is set to-1
Choices/src/scripts/defaults.ts
Line 41 in 8c0c11e
i.e. Choices.js will always show all entries of the
<select>
. But when searching for something - which would already filter down the entries to less or equal than all - the result is suddenly limited to 4.So I think it makes sense that the default for
searchResultLimit
should always be the same asrenderChoiceLimit
.Generally I am not sure what the use-case is for having a
searchResultLimit
that is lower than therenderChoiceLimit
.Types of changes
I think this constitutes a breaking change because if someone configured a
renderChoiceLimit
because they have a lot of<option>
s and they did not set asearchResultLimit
, they would suddenly potentially get more search results than theirrenderChoiceLimit
.Checklist