Skip to content

Commit

Permalink
Fix save button in Edit view - add id to form and form attribute to b…
Browse files Browse the repository at this point in the history
…utton. Edit view form now completed refactored away from table.
  • Loading branch information
BrettEastman committed Nov 7, 2023
1 parent 51c02e7 commit 79b8d3c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/iep/Iep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const Iep = ({ iep_id }: IepProps) => {
}

return (
<Stack>
<Stack sx={{ width: 1 }}>
<Container>
<Box className={$Iep.goalBox}>
<p className={$Iep.goalTab}>Goals &#40;{goals?.length ?? 0}&#41;</p>
Expand Down
22 changes: 11 additions & 11 deletions src/pages/students/[student_id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ const ViewStudentPage = () => {
return (
<Stack
spacing={2}
// sx={{
// display: "flex",
// flexDirection: "column",
// alignItems: "center",
// width: "100vu",
// }}
sx={{
display: "flex",
flexDirection: "column",
alignItems: "center",
width: "100%",
}}
>
<Container
className={$StudentPage.studentInfoContainer}
Expand Down Expand Up @@ -176,7 +176,7 @@ const ViewStudentPage = () => {
>
Cancel
</Button>
{/* <Button
<Button
className={`${$button.default} ${$home.bold}`}
sx={[
{
Expand All @@ -191,11 +191,11 @@ const ViewStudentPage = () => {
buttonSX,
]}
type="submit"
onClick={handleEditStudent}
form="edit"
variant="contained"
>
Save
</Button> */}
</Button>
</Box>
)}
</Box>
Expand Down Expand Up @@ -223,7 +223,7 @@ const ViewStudentPage = () => {

{viewState === VIEW_STATES.EDIT ? (
<Stack gap={0.5} sx={{ justifyContent: "center" }}>
<form onSubmit={handleEditStudent}>
<form id="edit" onSubmit={handleEditStudent}>
<Stack gap={0.5}>
<Container
className={$StudentPage.studentEditContainer}
Expand Down Expand Up @@ -294,7 +294,7 @@ const ViewStudentPage = () => {
/>
</Container>
</Stack>
<button type="submit">Submit</button>
{/* <button type="submit">Submit</button> */}
</form>

<Container sx={{ marginTop: "2rem" }}>
Expand Down

0 comments on commit 79b8d3c

Please sign in to comment.