100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps
Java asset-managementbuildingdashboarddataplatformdevice-managementedge-computingenergyenergy-managementenergy-monitorfleet-managementfleet-telematicsiotiot-applicationiot-platformmodbusmqttmqtt-brokerota-updaterules-enginesmartcity
floating label now correctly shown when input value is 0 (#987)
DonWillemsedba652958f4
diff --git a/ui/component/or-mwc-components/src/or-mwc-input.ts b/ui/component/or-mwc-components/src/or-mwc-input.tsindex bde671ea7..366f9ea9c 100644--- a/ui/component/or-mwc-components/src/or-mwc-input.ts+++ b/ui/component/or-mwc-components/src/or-mwc-input.ts@@ -868,7 +868,7 @@ export class OrMwcInput extends LitElement {"mdc-text-field-helper-text--persistent": !showValidationMessage && this.helperPersistent,"mdc-text-field-helper-text--validation-msg": showValidationMessage,};- const hasValue = this.value || this.value === false;+ const hasValue = (this.value !== null && this.value !== undefined) || this.value === false;let labelTemplate = showLabel ? html`<span class="mdc-floating-label ${hasValue ? "mdc-floating-label--float-above" : ""}" id="label">${this.label}</span>` : undefined;switch (this.type) {