1
0
mirror of https://github.com/s00500/ESPUI.git synced 2024-12-25 04:00:49 +00:00

Fixes #136 and also severe bug in addControl

This commit is contained in:
Ian Gray 2021-12-29 16:37:48 +00:00
parent eebefd915c
commit 1df56772d9

View File

@ -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)
{