Эх сурвалжийг харах

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

杨奕 8 жил өмнө
parent
commit
441f4c31a9

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

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