Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Feature/mwc input check attr descriptor optional (#729)

Robin Dekkers6cb95dbb03df
diff --git a/ui/component/or-mwc-components/src/or-mwc-input.ts b/ui/component/or-mwc-components/src/or-mwc-input.ts
index 8e13edf6f..cfdd61b0c 100644
--- a/ui/component/or-mwc-components/src/or-mwc-input.ts
+++ b/ui/component/or-mwc-components/src/or-mwc-input.ts
@@ -332,7 +332,7 @@ export const getValueHolderInputTemplateProvider: ValueInputProviderGenerator =
if (patternConstraint) {
pattern = patternConstraint.regexp;
}
- if (notNullConstraint) {
+ if (notNullConstraint || (valueHolderDescriptor && (valueHolderDescriptor as any).optional === false)) {
required = true;
}
if (notBlankConstraint && !pattern) {