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
(ngModelChange)="valueChange.emit($event)"
[(ngModel)]="value"
@ -20,7 +20,6 @@
*ngIf="!isSearch"
[disabled]="!hasContent"
[icon]="icon"
[isSubmit]="true"
[size]="25"
></iqser-circle-button>
</form>

View File

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