Skip to content

Commit 0ce21b9

Browse files
committed
fix #175: use defaultValue for input tag instead of value
1 parent aa0030e commit 0ce21b9

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

web/src/app/[locale]/registration/page.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default function Page() {
6868
id="name"
6969
type="text"
7070
name="name"
71-
value={ctx.formData.name}
71+
defaultValue={ctx.formData.name}
7272
onChange={ctx.handleChange}
7373
required
7474
maxLength={NAME_MAX_LENGTH}
@@ -84,9 +84,9 @@ export default function Page() {
8484

8585
<select
8686
id="gender"
87-
defaultValue=""
8887
required
8988
name="gender"
89+
defaultValue=""
9090
value={ctx.formData.gender}
9191
onChange={ctx.handleChange}
9292
className="my-4 w-full rounded-xl border border-gray-500 bg-white p-2 sm:w-1/2"
@@ -133,9 +133,9 @@ export default function Page() {
133133
<select
134134
name="universityId"
135135
onChange={ctx.handleChange}
136+
defaultValue=""
136137
value={ctx.formData.universityId}
137138
className="my-4 w-full rounded-xl border border-gray-500 bg-white p-2 sm:w-1/2"
138-
defaultValue=""
139139
required
140140
>
141141
<option value="" disabled className="select" />
@@ -150,9 +150,9 @@ export default function Page() {
150150
{t("settings.university.divisions")}
151151
<select
152152
name="divisionId"
153+
defaultValue=""
153154
value={ctx.formData.divisionId}
154155
onChange={ctx.handleChange}
155-
defaultValue=""
156156
required
157157
className="my-4 w-full rounded-xl border border-gray-500 bg-white p-2 sm:w-1/2"
158158
disabled={ctx.loadingUniversitySpecificData}
@@ -172,6 +172,7 @@ export default function Page() {
172172
{t("settings.university.campus")}
173173
<select
174174
name="campusId"
175+
defaultValue=""
175176
value={ctx.formData.campusId}
176177
onChange={ctx.handleChange}
177178
className="my-4 w-full rounded-xl border border-gray-500 bg-white p-2 sm:w-1/2"

web/src/features/settings/PageNav.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import LanguageSwitcher from "@/components/LanguageSelectar.tsx";
33
import { useGoogleLogout } from "@/features/auth/functions/logout.ts";
44
import { Link } from "@/i18n/navigation.ts";
5+
import clsx from "clsx";
56
import { useTranslations } from "next-intl";
67
import { AiOutlineRight } from "react-icons/ai";
78
import { blocks } from "./path-blocks.ts";
@@ -21,10 +22,14 @@ export default function PageNav() {
2122
<Link
2223
href={item.href}
2324
key={item.href}
24-
className={`flex items-center justify-between bg-neutral-50 p-3 px-8 text-gray-800 text-md ${index === 0 ? "rounded-t-xl" : index === self.length - 1 ? "rounded-b-xl" : ""}`}
25+
className={clsx([
26+
"flex items-center justify-between bg-neutral-50 p-3 px-8 text-md",
27+
index === 0 ? "rounded-t-xl" : index === self.length - 1 ? "rounded-b-xl" : "",
28+
item.variant === "danger" ? "text-error" : "text-gray-800 ",
29+
])}
2530
>
2631
{t(item.title)}
27-
<AiOutlineRight />
32+
<AiOutlineRight className="text-gray-800" />
2833
</Link>
2934
))}
3035
</section>

web/src/features/settings/UserFormController.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,8 @@ export const UserFormProvider = ({
156156
// 大学固有の static データを取得
157157
useEffect(() => {
158158
if (!formData.universityId) return;
159-
console.log(`fetching university-specific data for university ${formData.universityId} ...`);
160-
161159
const fetchCampusAndDivisions = async () => {
160+
console.log(`fetching university-specific data for university ${formData.universityId} ...`);
162161
setLoadingUniversitySpecificData(true);
163162
try {
164163
const [campusRes, divisionRes] = await Promise.all([

0 commit comments

Comments
 (0)