From: Bill Erickson Date: Wed, 10 Nov 2021 15:18:58 +0000 (-0500) Subject: LP1904036 org-select rejects invalid free text X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c5a6dd27e3e1f293df6331ea2ba8981bd973cc2f;p=Evergreen.git LP1904036 org-select rejects invalid free text Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.html b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.html index 89d7bb51b4..5a38457fea 100644 --- a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.html +++ b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.html @@ -21,6 +21,7 @@ [ngbTypeahead]="filter" [resultTemplate]="displayTemplate" [inputFormatter]="formatter" + (blur)="handleBlur()" (click)="click$.next($event.target.value)" (selectItem)="orgChanged($event)" container="body" diff --git a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts index 6a8bd9eea0..d0a1b7946c 100644 --- a/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts +++ b/Open-ILS/src/eg2/src/app/share/org-select/org-select.component.ts @@ -338,6 +338,13 @@ export class OrgSelectComponent implements OnInit { }); } + // Free-text values are not allowed. + handleBlur() { + if (typeof this.selected === 'string') { + this.selected = null; + } + } + filter = (text$: Observable): Observable => { return text$.pipe(