luci-base: fix off-by-one in cbi_update_table()
authorJo-Philipp Wich <jo@mein.io>
Thu, 15 Jul 2021 06:13:31 +0000 (08:13 +0200)
committerJo-Philipp Wich <jo@mein.io>
Thu, 15 Jul 2021 06:13:31 +0000 (08:13 +0200)
Fixes: #5189
Fixes: f919635310 ("luci-base: batch DOM updates to prevent slowdown")
Ref: https://github.com/openwrt/luci/commit/f919635310286b3b905aedb716d707da1ea2c811#commitcomment-53495580
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 2fc2f0963271981ac0eee69824f49cffa0cba31c..513256e4c9bfea559a54133e8950bc662972c095 100644 (file)
@@ -773,7 +773,7 @@ function cbi_update_table(table, data, placeholder) {
                                trows[n] = trow;
                        });
 
-                       for (var i = 1; i < n; i++) {
+                       for (var i = 1; i <= n; i++) {
                                if (rows[i])
                                        target.replaceChild(trows[i], rows[i]);
                                else