Skip to content

Commit ea930aa

Browse files
committed
SVY-20293 onDataChange not called in TiNG on typeahead-fields on click
away [SERVOY]
1 parent 8140225 commit ea930aa

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

projects/bootstrapcomponents/src/typeahead/typeahead.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,18 @@ export class ServoyBootstrapTypeahead extends ServoyBootstrapBasefield<HTMLInput
146146

147147
pushUpdate() {
148148
if (!this.dataProviderID && (!this.isEditable() || this.findmode)) {
149+
// need to restore value from UI
149150
if (this.findmode || !this.valuelistID) {
150151
this.dataProviderID = this.elementRef.nativeElement.value;
151152
} else {
152-
const allowEmptyValue = this.valuelistID[0]?.displayValue === '' && this.valuelistID[0]?.realValue === null;
153-
if (!allowEmptyValue) {
154-
if (this.valuelistID[0]?.displayValue && this.valuelistID[0]?.realValue && this.elementRef.nativeElement.value === this.valuelistID[0]?.displayValue) {
155-
this.dataProviderID = this.valuelistID[0]?.realValue;
156-
this.currentValue = this.dataProviderID;
157-
} else {
158-
this.dataProviderID = this.currentValue;
159-
}
160-
return;
153+
if (this.elementRef.nativeElement.value === this.valuelistID[0]?.displayValue) {
154+
this.dataProviderID = this.valuelistID[0]?.realValue;
155+
this.currentValue = this.dataProviderID;
156+
super.pushUpdate();
157+
} else {
158+
this.dataProviderID = this.currentValue;
161159
}
160+
return;
162161
}
163162
}
164163
this.currentValue = this.dataProviderID;

0 commit comments

Comments
 (0)