Skip to content

Commit a62dfb9

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

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
@@ -145,17 +145,16 @@ export class ServoyBootstrapTypeahead extends ServoyBootstrapBasefield<HTMLInput
145145

146146
pushUpdate() {
147147
if (!this.dataProviderID && !this.isEditable()) {
148+
// need to restore value from UI
148149
if (this.valuelistID) {
149-
const allowEmptyValue = this.valuelistID[0]?.displayValue === '' && this.valuelistID[0]?.realValue === null;
150-
if (!allowEmptyValue) {
151-
if (this.valuelistID[0]?.displayValue && this.valuelistID[0]?.realValue && this.elementRef.nativeElement.value === this.valuelistID[0]?.displayValue) {
152-
this.dataProviderID = this.valuelistID[0]?.realValue;
153-
this.currentValue = this.dataProviderID;
154-
} else {
155-
this.dataProviderID = this.currentValue;
156-
}
157-
return;
150+
if (this.elementRef.nativeElement.value === this.valuelistID[0]?.displayValue) {
151+
this.dataProviderID = this.valuelistID[0]?.realValue;
152+
this.currentValue = this.dataProviderID;
153+
super.pushUpdate();
154+
} else {
155+
this.dataProviderID = this.currentValue;
158156
}
157+
return;
159158
} else {
160159
this.dataProviderID = this.elementRef.nativeElement.value;
161160
}

0 commit comments

Comments
 (0)