Explorar o código

Table: remove highlight class after data change (#1977)

杨奕 %!s(int64=8) %!d(string=hai) anos
pai
achega
441f4c31a9
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      packages/table/src/table-body.js

+ 2 - 0
packages/table/src/table-body.js

@@ -95,6 +95,8 @@ export default {
       const newRow = rows[data.indexOf(newVal)];
       if (oldRow) {
         oldRow.classList.remove('current-row');
+      } else if (rows) {
+        [].forEach.call(rows, row => row.classList.remove('current-row'));
       }
       if (newRow) {
         newRow.classList.add('current-row');