From e809fa0069b5be6bf3a64ad914440b84ba5646c0 Mon Sep 17 00:00:00 2001 From: m2rt Date: Mon, 4 May 2026 09:48:22 +0300 Subject: [PATCH] fix(select): clear placeholder on value select #432 --- tedi/components/form/select/select.component.html | 2 +- .../form/select/select.component.spec.ts | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tedi/components/form/select/select.component.html b/tedi/components/form/select/select.component.html index 4451b32e..04fbefa2 100644 --- a/tedi/components/form/select/select.component.html +++ b/tedi/components/form/select/select.component.html @@ -61,7 +61,7 @@ type="text" class="tedi-select__search-input" [class.tedi-select__search-input--hidden]="showSingleSelectedValue()" - [placeholder]="placeholder()" + [placeholder]="showSingleSelectedValue() ? '' : placeholder()" [value]="searchTerm()" [disabled]="disabled()" (input)="onSearchInput($event)" diff --git a/tedi/components/form/select/select.component.spec.ts b/tedi/components/form/select/select.component.spec.ts index 5cd081b9..6796716e 100644 --- a/tedi/components/form/select/select.component.spec.ts +++ b/tedi/components/form/select/select.component.spec.ts @@ -548,6 +548,20 @@ describe("SelectComponent", () => { expect(select.searchTerm()).toBe(""); })); + it("should not show placeholder on search input after a value is selected", fakeAsync(() => { + getTrigger().click(); + fixture.detectChanges(); + tick(); + + const options = getOptions(); + options[0].click(); + fixture.detectChanges(); + tick(); + + const input = getSearchInput(); + expect(input.getAttribute("placeholder")).toBe(""); + })); + it("should open dropdown when typing", fakeAsync(() => { const input = getSearchInput(); input.value = "O";