diff --git a/README.md b/README.md index 298c89f..4e254bf 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ Full documentation is available on https://Hieromon.github.io/AutoConnect, some - Supports **AutoConnectElement::as** function to easily coding for conversion from an AutoConnectElement to an actual type. - Supports new element type **AutoConnectFile** and built-in file uploader. - Supports a **format attribute** with the AutoConnectText element. +- Supports a **AutoConnectSelect::selected** attribute. - Fixed blank page responds with Configure new. - Changed menu labels placement in source files structure. diff --git a/src/AutoConnectElementBasisImpl.h b/src/AutoConnectElementBasisImpl.h index 4caf555..24f5fd4 100644 --- a/src/AutoConnectElementBasisImpl.h +++ b/src/AutoConnectElementBasisImpl.h @@ -181,21 +181,23 @@ void AutoConnectRadioBasis::empty(const size_t reserve) { const String AutoConnectRadioBasis::toHTML(void) const { String html = String(""); - if (label.length()) { - html = label; - if (order == AC_Vertical) - html += String(F("
")); - } - uint8_t n = 0; - for (const String value : _values) { - n++; - String id = name + "_" + String(n); - html += String(F("")); - if (order == AC_Vertical) - html += String(F("
")); + if (enable) { + if (label.length()) { + html = label; + if (order == AC_Vertical) + html += String(F("
")); + } + uint8_t n = 0; + for (const String value : _values) { + n++; + String id = name + "_" + String(n); + html += String(F("")); + if (order == AC_Vertical) + html += String(F("
")); + } } return html; } @@ -245,17 +247,19 @@ void AutoConnectSelectBasis::select(const String& value) { const String AutoConnectSelectBasis::toHTML(void) const { String html = String(""); - if (label.length()) - html = String(F("")); - html += String(F(""); + uint8_t n = 1; + for (const String option : _options) { + html += String(F("