Input with action fixes

This commit is contained in:
Adina Țeudan 2022-01-15 19:42:12 +02:00
parent 795a273c9c
commit ff9dad3ce7
2 changed files with 3 additions and 4 deletions

View File

@ -1,4 +1,4 @@
<form [style.max-width]="computedWidth" [style.width]="computedWidth" class="iqser-input-group"> <form (submit)="executeAction(null)" [style.max-width]="computedWidth" [style.width]="computedWidth" class="iqser-input-group">
<input <input
(ngModelChange)="valueChange.emit($event)" (ngModelChange)="valueChange.emit($event)"
[(ngModel)]="value" [(ngModel)]="value"
@ -20,7 +20,6 @@
*ngIf="!isSearch" *ngIf="!isSearch"
[disabled]="!hasContent" [disabled]="!hasContent"
[icon]="icon" [icon]="icon"
[isSubmit]="true"
[size]="25" [size]="25"
></iqser-circle-button> ></iqser-circle-button>
</form> </form>

View File

@ -27,7 +27,7 @@ export class InputWithActionComponent {
} }
get isSearch(): boolean { get isSearch(): boolean {
return this.action.observers.length === 0; return !this.icon;
} }
reset(): void { reset(): void {
@ -37,7 +37,7 @@ export class InputWithActionComponent {
} }
executeAction($event: MouseEvent): void { executeAction($event: MouseEvent): void {
$event.stopPropagation(); $event?.stopPropagation();
if (this.hasContent) { if (this.hasContent) {
this.action.emit(this.value); this.action.emit(this.value);