File tree 1 file changed +21
-4
lines changed
1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change 222
222
this .MdTable .hasValue = this .hasValue
223
223
}
224
224
},
225
- ' MdTable.selectedItems' (val) {
226
- this .select (val)
225
+ ' MdTable.selectedItems' (val, old) {
226
+ let changed = (() => {
227
+ let isValEmpty = ! val || val .length === 0
228
+ let isOldEmpty = ! old || old .length === 0
229
+
230
+ if (isValEmpty && isOldEmpty) {
231
+ return false
232
+ } else if (! isValEmpty && ! isOldEmpty) {
233
+ return (val .length !== old .length ) ? true : ! val .every ((item , index ) => item == old[index])
234
+ } else {
235
+ return true
236
+ }
237
+ })()
238
+
239
+ if (changed) {
240
+ this .select (val)
241
+ }
227
242
},
228
- ' MdTable.singleSelection' (val) {
229
- this .select (val)
243
+ ' MdTable.singleSelection' (val, old) {
244
+ if (val != old) {
245
+ this .select (val)
246
+ }
230
247
},
231
248
mdSelectedValue () {
232
249
this .syncSelectedValue ()
You can’t perform that action at this time.
0 commit comments