mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
fix: preventDefault() forget
Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user