From 1df56772d9b81a8f3c0f7422318ef70a1100a2ef Mon Sep 17 00:00:00 2001 From: Ian Gray Date: Wed, 29 Dec 2021 16:37:48 +0000 Subject: [PATCH] Fixes #136 and also severe bug in addControl --- src/ESPUI.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ESPUI.cpp b/src/ESPUI.cpp index afd8032..5db5aff 100644 --- a/src/ESPUI.cpp +++ b/src/ESPUI.cpp @@ -590,7 +590,7 @@ void onWsEvent( uint16_t ESPUIClass::addControl(ControlType type, const char* label, const String& value, ControlColor color, uint16_t parentControl, void (*callback)(Control*, int)) { - Control* control = new Control(type, label, callback, value, color, parentControl); + Control* control = new Control(type, label, callback, value, color, true, parentControl); if (this->controls == nullptr) { @@ -969,6 +969,7 @@ void ESPUIClass::jsonDom(AsyncWebSocketClient* client) item["label"] = control->label; item["value"] = String(control->value); item["color"] = (int)control->color; + item["visible"] = control->visible; if (control->parentControl != Control::noParent) {