Skip to content

Commit

Permalink
Fix/ie problem (#4444)
Browse files Browse the repository at this point in the history
* Fixed IE search bug when setting showSearchButton

* Fix IE11 cannot work bug
  • Loading branch information
wenzhixin authored and djhvscf committed Jun 24, 2019
1 parent e228873 commit c140bb7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 26 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.js
Expand Up @@ -64,7 +64,8 @@ module.exports = {
'no-useless-constructor': 'warn',
'comma-dangle': ['error', 'never'],
'no-param-reassign': 'off',
'space-before-function-paren': ["error", "always"]
'space-before-function-paren': ["error", "always"],
'no-prototype-builtins': 'off'
},
'globals': {
'$': true,
Expand Down
30 changes: 15 additions & 15 deletions package.json
Expand Up @@ -7,29 +7,29 @@
"doc": "site"
},
"devDependencies": {
"@babel/core": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"core-js": "^3.0.0",
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"chalk": "^2.4.2",
"core-js": "^3.1.4",
"cssmin-cli": "^0.0.5",
"eslint": "^4.19.1",
"glob": "^7.1.3",
"eslint": "^6.0.0",
"esm": "^3.2.25",
"glob": "^7.1.4",
"headr": "^0.0.4",
"npm-run-all": "^4.1.5",
"rollup": "^1.8.0",
"rollup-plugin-babel": "^4.3.2",
"rollup": "^1.16.2",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-babel-minify": "^8.0.0",
"rollup-plugin-commonjs": "^9.3.4",
"rollup-plugin-inject": "^2.2.0",
"rollup-plugin-commonjs": "^10.0.0",
"rollup-plugin-inject": "^3.0.0",
"rollup-plugin-multi-entry": "^2.1.0",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-node-resolve": "^5.0.4",
"rollup-plugin-vue": "^5.0.0",
"sass": "^1.16.1",
"safe-eval": "^0.4.1",
"sass": "^1.21.0",
"stylelint": "^10.1.0",
"stylelint-config-standard": "^18.3.0",
"vue-template-compiler": "^2.6.10",
"chalk": "^2.4.2",
"esm": "^3.2.25",
"safe-eval": "^0.4.1"
"vue-template-compiler": "^2.6.10"
},
"scripts": {
"lint:js": "eslint src",
Expand Down
14 changes: 4 additions & 10 deletions src/bootstrap-table.js
Expand Up @@ -643,7 +643,10 @@ class BootstrapTable {
this.$toolbar.append(html.join(''))
const $searchInput = this.$toolbar.find('.search input')
$search = o.showSearchButton ? this.$toolbar.find('.search button[name=search]') : $searchInput
const eventTriggers = o.showSearchButton ? 'click' : 'keyup drop blur'

const eventTriggers = o.showSearchButton ? 'click' :
(Utils.isIEBrowser() ? 'mouseup' : 'keyup drop blur')

$search.off(eventTriggers).on(eventTriggers, event => {
if (o.searchOnEnterKey && event.keyCode !== 13) {
return
Expand All @@ -665,15 +668,6 @@ class BootstrapTable {
this.onSearch({currentTarget: this.$toolbar.find('.search input')})
})
}

if (Utils.isIEBrowser()) {
$search.off('mouseup').on('mouseup', event => {
clearTimeout(timeoutId) // doesn't matter if it's 0
timeoutId = setTimeout(() => {
this.onSearch(event)
}, o.searchTimeOut)
})
}
}
}

Expand Down

0 comments on commit c140bb7

Please sign in to comment.