Skip to content

Commit

Permalink
Table: fix toggleAllSelection behavior when data is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
adaex committed Aug 28, 2021
1 parent c50a0bf commit 010c537
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/table/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export const cellForced = {
selection: {
renderHeader: function(h, { store }) {
return <el-checkbox
nativeOn-click={ (event) => event.stopPropagation() }
on-input={ () => { store.commit('toggleAllSelection'); } }
disabled={ store.states.data && store.states.data.length === 0 }
indeterminate={ store.states.selection.length > 0 && !this.isAllSelected }
nativeOn-click={ this.toggleAllSelection }
value={ this.isAllSelected } />;
},
renderCell: function(h, { row, column, store, $index }) {
Expand Down
5 changes: 0 additions & 5 deletions packages/table/src/table-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,6 @@ export default {
return classes.join(' ');
},

toggleAllSelection(event) {
event.stopPropagation();
this.store.commit('toggleAllSelection');
},

handleFilterClick(event, column) {
event.stopPropagation();
const target = event.target;
Expand Down

0 comments on commit 010c537

Please sign in to comment.