From 38b84bb8051db2f03b152d66c34a1cb4c8944a12 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Fri, 12 Nov 2021 13:12:27 -0300 Subject: fix #7059 --- packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx') diff --git a/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx b/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx index 4a937d855..1b50779e0 100644 --- a/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx +++ b/packages/anastasis-webui/src/pages/home/AttributeEntryScreen.tsx @@ -44,6 +44,11 @@ export function AttributeEntryScreen(): VNode { setValue={(v: string) => setAttrs({ ...attrs, [spec.name]: v })} spec={spec} errorMessage={error} + onConfirm={() => { + if (!hasErrors) { + setAskUserIfSure(true) + } + }} value={value} /> ); @@ -104,6 +109,7 @@ interface AttributeEntryFieldProps { setValue: (newValue: string) => void; spec: UserAttributeSpec; errorMessage: string | undefined; + onConfirm: () => void; } const possibleBirthdayYear: Array = []; for (let i = 0; i < 100; i++) { @@ -117,6 +123,7 @@ function AttributeEntryField(props: AttributeEntryFieldProps): VNode { grabFocus={props.isFirst} label={props.spec.label} years={possibleBirthdayYear} + onConfirm={props.onConfirm} error={props.errorMessage} bind={[props.value, props.setValue]} /> @@ -125,6 +132,7 @@ function AttributeEntryField(props: AttributeEntryFieldProps): VNode { @@ -133,6 +141,7 @@ function AttributeEntryField(props: AttributeEntryFieldProps): VNode { -- cgit v1.2.3