Skip to content

Commit

Permalink
fixed primefaces#7841 forceSelection not clearing invalid single numb…
Browse files Browse the repository at this point in the history
…ers/strings
  • Loading branch information
yigitfindikli committed Aug 2, 2019
1 parent c2a2d86 commit e80663b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,18 @@ export class AutoComplete implements AfterViewChecked,AfterContentInit,DoCheck,O
this.onModelChange(this.value);
}
}
else if (this.forceSelection && !this.suggestions) {
if (this.multiple) {
this.multiInputEL.nativeElement.value = '';
}
else {
this.value = null;
this.inputEL.nativeElement.value = '';
}

this.onClear.emit(event);
this.onModelChange(this.value);
}
}

onInputPaste(event: ClipboardEvent) {
Expand Down

0 comments on commit e80663b

Please sign in to comment.