From 82159e34e53c95eeff4886c03f70b2978110cc00 Mon Sep 17 00:00:00 2001 From: d0r1s <1311331039@qq.com> Date: Tue, 27 Sep 2022 19:19:42 +0800 Subject: [PATCH] fix(module:select): input field length restricted to 82px (#7626) Signed-off-by: LemniscateX <1311331039@qq.com> 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`); }