Realign with upstream

This commit is contained in:
Ian Gray 2022-01-03 15:39:48 +00:00
parent 0ab401c3b1
commit 7e5331d54f
1 changed files with 8 additions and 4 deletions

View File

@ -1035,17 +1035,21 @@ Control* ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, Control* con
if (control->elementStyle != 0)
item["elementStyle"] = String(control->elementStyle);
if (control->parentControl != Control::noParent) {
if (control->parentControl != Control::noParent)
{
item["parentControl"] = String(control->parentControl);
}
// special case for selects: to preselect an option, you have to add
// "selected" to <option>
if (control->type == ControlType::Option) {
if (ESPUI.getControl(control->parentControl)->value == control->value) {
if (control->type == ControlType::Option)
{
if (ESPUI.getControl(control->parentControl)->value == control->value)
{
item["selected"] = "selected";
}
else {
else
{
item["selected"] = "";
}
}