diff --git a/projects/kit/components/input-tag/input-tag.component.ts b/projects/kit/components/input-tag/input-tag.component.ts index 45e8d2666c23..ad9e1ddd8073 100644 --- a/projects/kit/components/input-tag/input-tag.component.ts +++ b/projects/kit/components/input-tag/input-tag.component.ts @@ -382,7 +382,7 @@ export class TuiInputTagComponent } onTagEdited(value: string, index: number): void { - this.focusInput(); + this.focusInput(value === ''); this.value = this.filterValue( this.value .map((tag, tagIndex) => @@ -518,9 +518,7 @@ export class TuiInputTagComponent } private focusInput(preventScroll: boolean = false): void { - if (this.nativeFocusableElement) { - this.nativeFocusableElement.focus({preventScroll}); - } + this.nativeFocusableElement?.focus({preventScroll}); } private clippedValue(value: string): string { diff --git a/projects/kit/components/tag/tag.template.html b/projects/kit/components/tag/tag.template.html index 8e3d0a59883c..aca81f3272a7 100644 --- a/projects/kit/components/tag/tag.template.html +++ b/projects/kit/components/tag/tag.template.html @@ -28,7 +28,7 @@ class="t-icon" [src]="icons.close" (click)="remove($event)" - (mousedown.prevent.silent)="(0)" + (mousedown.stop.prevent.silent)="(0)" >