File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -54,8 +54,8 @@ const COMPONENTS_MAP: ComponentsMap = {
5454 },
5555 }),
5656 array : (key , zodType ) => {
57- const sub_element = zodType .def .element
58- if (sub_element instanceof z .ZodEnum ) {
57+ const innerType = zodType .def .element
58+ if (innerType instanceof z .ZodEnum ) {
5959 const result = mapZodTypeToComponent (key , zodType .unwrap ()) as any
6060 result .componentProps .multiple = true
6161 return result
@@ -65,7 +65,15 @@ const COMPONENTS_MAP: ComponentsMap = {
6565 (state as any )[key ] = zodType .def .defaultValue
6666 return mapZodTypeToComponent (key , zodType .unwrap ())
6767 },
68- email : () => ({ component: UInput , componentProps: { type: ' email' } }),
68+ email : (key , _ ) => {
69+ const stringComponent = mapZodTypeToComponent (key , ' string' )!
70+
71+ return defu ({
72+ componentProps: {
73+ type: ' email' ,
74+ },
75+ }, stringComponent )
76+ },
6977}
7078
7179const defaults: Partial <AutoFormConfig > = {
You can’t perform that action at this time.
0 commit comments