ソースを参照

Merge pull request #5582 from pieral85/fix/5581

Allow exact match when searching term with accent
Dustin Utecht 4 年 前
コミット
4b30e19ae4
1 ファイル変更5 行追加1 行削除
  1. 5 1
      src/bootstrap-table.js

+ 5 - 1
src/bootstrap-table.js

@@ -956,9 +956,13 @@ class BootstrapTable {
         return
       }
 
-      const s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase()
+      let s = this.searchText && (this.fromHtml ? Utils.escapeHTML(this.searchText) : this.searchText).toLowerCase()
       const f = Utils.isEmptyObject(this.filterColumns) ? null : this.filterColumns
 
+      if (this.options.searchAccentNeutralise) {
+        s = Utils.normalizeAccent(s)
+      }
+
       // Check filter
       if (typeof this.filterOptions.filterAlgorithm === 'function') {
         this.data = this.options.data.filter(item => this.filterOptions.filterAlgorithm.apply(null, [item, f]))