Skip to content

Commit

Permalink
Merge pull request #9 from RandomSoftwareSL/bugfix/placeholder-not-av…
Browse files Browse the repository at this point in the history
…ailable

placeholder not availabel issues
  • Loading branch information
sachith94-lion authored May 16, 2024
2 parents 3c6ad58 + 5bbbded commit f29c2a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/type-head-input/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@randomsoftwareltd/type-head-input",
"version": "2.0.7",
"version": "2.0.8",
"peerDependencies": {
"@angular/common": "^17.2.3",
"@angular/core": "^17.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
(onHide)="select.resetFilter()"
[appNumbersOnly]="isNumberInput"
(onClick)="onClick()"
(onBlur)="setEmptyHandler()"
>
<!-- item template -->
<ng-template *ngIf="!itemTemplate" let-option pTemplate="item">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,10 @@ export class TypeHeadInputComponent {
}

onFilterEmitter(event: any) {
this.setEmptyHandler();
this.searchValue =
typeof this.select?.value === "object" &&
this.select?.value.hasOwnProperty("value")
this.select?.value?.hasOwnProperty("value")
? this.select?.value?.value
: this.select?.value;
if (this.enableServerSideData) {
Expand Down Expand Up @@ -217,4 +218,10 @@ export class TypeHeadInputComponent {
this.searchValue = "";
}
}

setEmptyHandler = () => {
if (this.control.value === "") {
this.control.patchValue(null);
}
};
}

0 comments on commit f29c2a2

Please sign in to comment.