1
0
mirror of https://github.com/s00500/ESPUI.git synced 2025-07-04 06:10:18 +00:00

Added 'type' proptert to text input elements

Now the text input element can support other HTML input types suxh as date, time, color, password, etc
This commit is contained in:
pcbbc
2022-05-22 23:31:48 +01:00
parent a958feb152
commit a53124de42
12 changed files with 33 additions and 16 deletions

View File

@ -848,7 +848,18 @@ void ESPUIClass::setElementStyle(uint16_t id, String style, int clientId)
}
}
void ESPUIClass::setPanelWide(uint16_t id, bool wide) {
void ESPUIClass::setInputType(uint16_t id, String type, int clientId)
{
Control* control = getControl(id);
if (control)
{
control->inputType = type;
updateControl(control, clientId);
}
}
void ESPUIClass::setPanelWide(uint16_t id, bool wide)
{
Control* control = getControl(id);
if (control)
{
@ -1124,6 +1135,8 @@ void ESPUIClass::prepareJSONChunk(AsyncWebSocketClient* client, uint16_t startin
item["panelStyle"] = String(control->panelStyle);
if (control->elementStyle.length())
item["elementStyle"] = String(control->elementStyle);
if (control->inputType.length())
item["inputType"] = String(control->inputType);
if (control->wide == true)
item["wide"] = true;
if (control->vertical == true)