Filter using select and search-formatter false fails to filter if falsy values available
Bootstraptable version(s) affected
1.21.0
Description
For filter control using select, if searchFormatter is false, then option values will be based on original values instead of formatted ones, which is good. The issue happens if one of the values is falsy (zero, false, etc.). In that case, the falsy option will have a formatted value, and only that filter option will work, all other values won't work.
Example(s)
https://live.bootstrap-table.com/code/jonatanschroeder/12702
Note that using a filter on the ID to select value 0 works, but for any other value it doesn't work. Inspecting the element it seems it's created as:
<select class="form-select bootstrap-table-filter-control-id " style="width: 100%;" dir="ltr">
<option value=""></option>
<option value="#0">#0</option>
<option value="1">#1</option>
<option value="2">#2</option>
<option value="3">#3</option>
<option value="4">#4</option>
<option value="5">#5</option>
</select>
Note the formatted value for option (although this was also the case in 1.20.2 and it worked then). Changing the data so that the ID is not falsy (e.g., "0") works as expected.
Possible Solutions
No response
Additional Context
Testing the same code in 1.20.2 seems to work.
This seems to be where the issue lies:
https://github.com/wenzhixin/bootstrap-table/blob/c1a4fb89ba039a89461c8488445ca757e42336ee/src/extensions/filter-control/utils.js#L310-L313
If my understanding is correct, the line above would cause the falsy value to force a use of the formatter and a search of formatted value, but this is not properly handled in non-formatted values.
I'm curious for the reason for the lines above. If its intention was to cover a blank string, wouldn't it make more sense to compare it with the blank string instead of a generic falsy test?