From 858be4f7aa1f66b7351c5b48d88462814a75410e Mon Sep 17 00:00:00 2001 From: j-w9 <295470691+j-w9@users.noreply.github.com> Date: Sun, 22 Nov 2026 11:18:50 -0500 Subject: [PATCH] ParameterMetadata: select the option for a number written with extra digits A drop down given 1.000000 (as MAVProxy and some GCS write parameters) had no matching option and read back as empty, so a loaded _ENABLE or _MODE of 0 or 1 was lost. --- Libraries/ParameterMetadata.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Libraries/ParameterMetadata.js b/Libraries/ParameterMetadata.js index 973ee882..6c6baebf 100644 --- a/Libraries/ParameterMetadata.js +++ b/Libraries/ParameterMetadata.js @@ -9,6 +9,11 @@ function parameter_set_value(name, value) { // set main input param.value = value + // A drop down ignores text that is not one of its options, try the number, e.g. 1.000000 for 1 + if ((param.tagName === "SELECT") && (param.selectedIndex < 0)) { + param.value = parseFloat(value) + } + // Set bits in bitmask let items = param.parentElement.querySelectorAll("input[type=checkbox]") for (let item of items) {