From 3b86fd1d1b690b6757aa47fe13bd9c381e6e7cc2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 19 Feb 2016 17:20:50 +0100 Subject: [PATCH] luci-base: cbi: fix button handling for dynamic lists Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 26fd92471f..b285ee26cc 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -592,6 +592,7 @@ function cbi_combobox(id, values, def, man, focus) { var obj = document.getElementById(id) var sel = document.createElement("select"); sel.id = selid; + sel.index = obj.index; sel.className = obj.className.replace(/cbi-input-text/, 'cbi-input-select'); if (obj.nextSibling) { @@ -925,14 +926,14 @@ function cbi_dynlist_init(parent, datatype, optional, choices) input.value = ''; cbi_dynlist_keydown({ - target: se, + target: input, keyCode: 8 }); } else { cbi_dynlist_keydown({ - target: se, + target: input, keyCode: 13 }); } -- 2.30.2