Skip to content

Commit

Permalink
Fixed IE search bug when setting showSearchButton
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhixin committed Jun 24, 2019
1 parent e228873 commit 50f4c54
Showing 1 changed file with 4 additions and 10 deletions.
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 50f4c54

Please sign in to comment.