From 441f4c31a960329a3f28f70a3334c610537cd1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=A5=95?= Date: Mon, 26 Dec 2016 16:07:14 +0800 Subject: [PATCH] Table: remove highlight class after data change (#1977) --- packages/table/src/table-body.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/table/src/table-body.js b/packages/table/src/table-body.js index 88000899d..683365bd6 100644 --- a/packages/table/src/table-body.js +++ b/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');