From db69210350e03fc78fa68dd364805c2cd896b496 Mon Sep 17 00:00:00 2001 From: LemniscateX <1311331039@qq.com> Date: Mon, 5 Sep 2022 10:45:42 +0800 Subject: [PATCH] fix(module:select): input field length restricted to 82px Signed-off-by: LemniscateX <1311331039@qq.com> --- components/select/select-search.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/select/select-search.component.ts b/components/select/select-search.component.ts index 903532275d..60df01c6e1 100644 --- a/components/select/select-search.component.ts +++ b/components/select/select-search.component.ts @@ -79,7 +79,7 @@ export class NzSelectSearchComponent implements AfterViewInit, OnChanges { const hostDOM = this.elementRef.nativeElement; const inputDOM = this.inputElement.nativeElement; this.renderer.removeStyle(hostDOM, 'width'); - mirrorDOM.innerHTML = this.renderer.createText(`${inputDOM.value} `); + this.renderer.setProperty(mirrorDOM, 'textContent', `${inputDOM.value}\u00a0`); this.renderer.setStyle(hostDOM, 'width', `${mirrorDOM.scrollWidth}px`); }