File tree Expand file tree Collapse file tree
projects/bootstrapcomponents/src/typeahead Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments