From 38b84bb8051db2f03b152d66c34a1cb4c8944a12 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Fri, 12 Nov 2021 13:12:27 -0300
Subject: fix #7059

---
 packages/anastasis-webui/src/components/fields/NumberInput.tsx | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'packages/anastasis-webui/src/components/fields/NumberInput.tsx')

diff --git a/packages/anastasis-webui/src/components/fields/NumberInput.tsx b/packages/anastasis-webui/src/components/fields/NumberInput.tsx
index e1489eafa..4856131c7 100644
--- a/packages/anastasis-webui/src/components/fields/NumberInput.tsx
+++ b/packages/anastasis-webui/src/components/fields/NumberInput.tsx
@@ -7,6 +7,7 @@ export interface TextInputProps {
   error?: string;
   placeholder?: string;
   tooltip?: string;
+  onConfirm?: () => void;
   bind: [string, (x: string) => void];
 }
 
@@ -36,6 +37,11 @@ export function PhoneNumberInput(props: TextInputProps): VNode {
           type="tel"
           placeholder={props.placeholder}
           class={showError ? "input is-danger" : "input"}
+          onKeyPress={(e) => {
+            if (e.key === 'Enter' && props.onConfirm) {
+              props.onConfirm()
+            }
+          }}
           onInput={(e) => {
             setDirty(true);
             props.bind[1]((e.target as HTMLInputElement).value);
-- 
cgit v1.2.3

