Browse Source

Added accent normalization for the filter-control extension (#6257)

Dustin Utecht 3 years ago
parent
commit
7b930f8a05
1 changed files with 5 additions and 1 deletions
  1. 5 1
      src/extensions/filter-control/bootstrap-table-filter-control.js

+ 5 - 1
src/extensions/filter-control/bootstrap-table-filter-control.js

@@ -217,10 +217,14 @@ $.BootstrapTable = class extends $.BootstrapTable {
         keys.forEach(key => {
           const thisColumn = that.columns[that.fieldsColumnsIndex[key]]
           const rawFilterValue = (filterPartial[key] || '')
-          const filterValue = rawFilterValue.toLowerCase()
+          let filterValue = rawFilterValue.toLowerCase()
           let value = Utils.unescapeHTML(Utils.getItemField(item, key, false))
           let tmpItemIsExpected
 
+          if (this.options.searchAccentNeutralise) {
+            filterValue = Utils.normalizeAccent(filterValue)
+          }
+
           if (filterValue === '') {
             tmpItemIsExpected = true
           } else {