Skip to content

Commit

Permalink
form-elements: update string name
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Jan 28, 2025
1 parent 5137ec5 commit 15752f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/form-elements/src/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class FormElementsDemo extends ScopedElementsMixin(DBPLitElement) {
this._i18n = createInstance();
this.lang = this._i18n.language;
this.saveButtonEnabled = true;
this.mySpecialComponentStringRef = createRef();
this.mySpecialStringRef = createRef();
this.myComponentDateTimeRef = createRef();
this.myComponentEnumRef = createRef();
this.data = {};
Expand Down Expand Up @@ -62,7 +62,7 @@ export class FormElementsDemo extends ScopedElementsMixin(DBPLitElement) {

this.updateComplete.then(() => {
// Add a custom validation function to the special string component
this.mySpecialComponentStringRef.value.customValidationFnc = (value, evaluationData) => {
this.mySpecialStringRef.value.customValidationFnc = (value, evaluationData) => {
// If the value is empty, return an error message with the evaluation data
return value === '' ? ['evaluationData: ' + JSON.stringify(evaluationData)] : [];
};
Expand Down Expand Up @@ -144,12 +144,12 @@ export class FormElementsDemo extends ScopedElementsMixin(DBPLitElement) {
</dbp-form-string-element>
<dbp-form-string-element
${ref(this.mySpecialComponentStringRef)}
${ref(this.mySpecialStringRef)}
subscribe="lang"
name="mySpecialComponentString"
name="mySpecialString"
description="Shows the evaluation data in the error message if empty"
label="My special string"
value=${data.mySpecialComponentString || ''}
value=${data.mySpecialString || ''}
required>
</dbp-form-string-element>
Expand Down

0 comments on commit 15752f2

Please sign in to comment.