From 475492545ff45084ab69249196bd7117f1f00389 Mon Sep 17 00:00:00 2001 From: FelipeDuarteLuna Date: Tue, 25 Jul 2023 20:42:49 -0300 Subject: [PATCH] feat(input): adicionando evento tecla enter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit O componente não escutava evento keyup.enter. Este commit implementa evento tecla enter. Fixes #1765, DTHFUI-7528 --- .../po-field/po-input/po-input-base.component.ts | 9 +++++++++ .../components/po-field/po-input/po-input.component.html | 1 + 2 files changed, 10 insertions(+) diff --git a/projects/ui/src/lib/components/po-field/po-input/po-input-base.component.ts b/projects/ui/src/lib/components/po-field/po-input/po-input-base.component.ts index dbe2b1d010..7811a509f9 100644 --- a/projects/ui/src/lib/components/po-field/po-input/po-input-base.component.ts +++ b/projects/ui/src/lib/components/po-field/po-input/po-input-base.component.ts @@ -114,6 +114,15 @@ export abstract class PoInputBaseComponent implements ControlValueAccessor, Vali */ @Output('p-blur') blur: EventEmitter = new EventEmitter(); + /** + * @optional + * + * @description + * + * Evento disparado ao pressionar tecla enter. + */ + @Output('p-enter-click') enterClick: EventEmitter = new EventEmitter(); + /** * @optional * diff --git a/projects/ui/src/lib/components/po-field/po-input/po-input.component.html b/projects/ui/src/lib/components/po-field/po-input/po-input.component.html index b29e18b001..6aa0c273af 100644 --- a/projects/ui/src/lib/components/po-field/po-input/po-input.component.html +++ b/projects/ui/src/lib/components/po-field/po-input/po-input.component.html @@ -32,6 +32,7 @@ (click)="eventOnClick($event)" (focus)="eventOnFocus($event)" (input)="eventOnInput($event)" + (keyup.enter)="enterClick.emit($event.target)" />