diff --git a/comps/custom/Tab.tsx b/comps/custom/Tab.tsx index 6462287..d38a303 100755 --- a/comps/custom/Tab.tsx +++ b/comps/custom/Tab.tsx @@ -99,6 +99,9 @@ export const Tab: FC<{ value={idx + ""} onClick={() => { local.activeIndex = idx.toString(); + if (local.mode === "hash") { + location.hash = `#${local.activeIndex}`; + } local.render(); if (e.navigate) { navigate(e.navigate); diff --git a/comps/form/Form.tsx b/comps/form/Form.tsx index 4adfcbb..8902599 100755 --- a/comps/form/Form.tsx +++ b/comps/form/Form.tsx @@ -17,10 +17,15 @@ export const Form: FC<{ return ( - { + e.preventDefault(); + e.stopPropagation(); + on_submit({ form: form.hook.getValues(), error: {} }); + }} > - + ); }; diff --git a/comps/list/List.tsx b/comps/list/List.tsx index 86574a8..c9ad396 100755 --- a/comps/list/List.tsx +++ b/comps/list/List.tsx @@ -60,7 +60,7 @@ export const List: FC = (_arg) => { {local.list === null ? ( ) : ( - local.list.map((item, idx) => { + (local.list || []).map((item, idx) => { const val = (...arg: any[]) => { const value = get(map_val(item), `${arg.join("")}`); return value; diff --git a/comps/ui/form.tsx b/comps/ui/form.tsx index c3bb741..7980b6c 100755 --- a/comps/ui/form.tsx +++ b/comps/ui/form.tsx @@ -11,7 +11,7 @@ import { } from "react-hook-form" import { cn } from "@/utils" -import { Label } from "@/comps//ui/label" +import { Label } from "@/comps/ui/label" const Form = FormProvider diff --git a/utils/pathname.ts b/utils/pathname.ts index 9eba160..a7f502b 100755 --- a/utils/pathname.ts +++ b/utils/pathname.ts @@ -2,6 +2,7 @@ export const getPathname = () => { if (["localhost", "prasi.avolut.com"].includes(location.hostname)) { if ( location.pathname.startsWith("/vi") || + location.pathname.startsWith("/prod") || location.pathname.startsWith("/deploy") ) { return "/" + location.pathname.split("/").slice(3).join("/");