Skip to content

Commit

Permalink
fix(module:select): fix input width in tags mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sebcam committed May 4, 2022
1 parent f09ba57 commit 2da7810
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/select/select-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ 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} `);
const textnode = this.renderer.createText(`${inputDOM.value} `);
mirrorDOM.appendChild(textnode);
this.renderer.setStyle(hostDOM, 'width', `${mirrorDOM.scrollWidth}px`);
this.renderer.removeChild(mirrorDOM, textnode);
}

focus(): void {
Expand Down

0 comments on commit 2da7810

Please sign in to comment.