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/TextInput.tsx | 6 ++++++
 1 file changed, 6 insertions(+)

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

diff --git a/packages/anastasis-webui/src/components/fields/TextInput.tsx b/packages/anastasis-webui/src/components/fields/TextInput.tsx
index 4f417730c..efa95d84e 100644
--- a/packages/anastasis-webui/src/components/fields/TextInput.tsx
+++ b/packages/anastasis-webui/src/components/fields/TextInput.tsx
@@ -8,6 +8,7 @@ export interface TextInputProps {
   error?: string;
   placeholder?: string;
   tooltip?: string;
+  onConfirm?: () => void;
   bind: [string, (x: string) => void];
 }
 
@@ -37,6 +38,11 @@ export function TextInput(props: TextInputProps): VNode {
           disabled={props.disabled}
           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

