fix: preventDefault() forget

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-04 05:25:46 +08:00
parent b0f40e5133
commit b54f6cdde0
@@ -189,7 +189,12 @@ export default function AddCourse() {
}
};
const handleNext = async () => {
const handleNext = async (e) => {
// The Next button occupies the same DOM position as the eventual
// type="submit" Create Course button. Advancing the step re-renders
// that node's type attribute in place *before* the browser evaluates
// this click's default action, which would otherwise submit the form.
e.preventDefault();
if (currentStep === 0) {
const valid = await trigger(["title", "subscription", "objectives"]);
if (!valid) return;