From af2ed319f7d1075a4a35ecb24b60d3bfa57907a8 Mon Sep 17 00:00:00 2001 From: zhixin Date: Wed, 13 Nov 2019 20:35:24 +0800 Subject: [PATCH] Fixed checkAll event bug with sortable checkbox field --- CHANGELOG.md | 1 + src/bootstrap-table.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dd8b1f5b1..97496595f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ ChangeLog - **Update:** Fixed `pageSize` set to all bug with filter. - **Update:** Fixed `jqXHR` `undefined` error using custom ajax. - **Update:** Fixed `refreshOptions` bug with radio and checkbox. +- **Update:** Fixed `checkAll` event bug with sortable checkbox field. - **Update:** Fixed checkbox and not-found td style errors. - **Update:** Fixed `hideUnusedSelectOptions` not work bug for filter-control extension. - **Update:** Fixed `virtualScroll` option bug with treegrid extension. diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js index 80011c7861..db16352ffe 100644 --- a/src/bootstrap-table.js +++ b/src/bootstrap-table.js @@ -360,8 +360,9 @@ class BootstrapTable { } this.$selectAll = this.$header.find('[name="btSelectAll"]') - this.$selectAll.off('click').on('click', ({currentTarget}) => { - const checked = $(currentTarget).prop('checked') + this.$selectAll.off('click').on('click', e => { + e.stopPropagation() + const checked = $(e.currentTarget).prop('checked') this[checked ? 'checkAll' : 'uncheckAll']() this.updateSelected() })