浏览代码

Fix filter-control when using & in value (#5385)

* Unescape & when comparing option in filter-control

* Unescape & when searching rows in filter-control
Alexandre "Moutarde" S 5 年之前
父节点
当前提交
222aa0a79d

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

@@ -189,7 +189,7 @@ $.BootstrapTable = class extends $.BootstrapTable {
         keys.forEach(key => {
           const thisColumn = that.columns[that.fieldsColumnsIndex[key]]
           const fval = (fp[key] || '').toLowerCase()
-          let value = Utils.getItemField(item, key, false)
+          let value = Utils.unescapeHTML(Utils.getItemField(item, key, false))
           let tmpItemIsExpected
 
           if (fval === '') {

+ 1 - 1
src/extensions/filter-control/utils.js

@@ -34,7 +34,7 @@ export function existOptionInSelectControl (selectControl, value) {
   const options = getOptionsFromSelectControl(selectControl)
 
   for (let i = 0; i < options.length; i++) {
-    if (options[i].value === value.toString()) {
+    if (options[i].value === Utils.unescapeHTML(value.toString())) {
       // The value is not valid to add
       return true
     }