Skip to content

[fix] 모의 성적 계산하기 유형 전환 시 폼 리셋 누락 수정#412

Merged
s2yeons merged 4 commits into
developfrom
fix/calculate-form-reset
Jun 9, 2026
Merged

[fix] 모의 성적 계산하기 유형 전환 시 폼 리셋 누락 수정#412
s2yeons merged 4 commits into
developfrom
fix/calculate-form-reset

Conversation

@s2yeons

@s2yeons s2yeons commented Jun 8, 2026

Copy link
Copy Markdown
Member

개요 💡

모의 성적 계산하기에서 검정고시 유형으로 입력 후 "이전" 버튼을 눌러 다른 유형(졸업 예정/졸업자)으로 전환하면, 모든 값을 입력해도 "내 성적 계산하기" 버튼이 활성화되지 않는 버그를 수정했습니다.

작업내용 ⌨️

  • "이전" 버튼 클릭 시 호출되는 handleBackClick에서 step4UseForm.reset()을 호출해 폼 상태를 초기화하는데, 이때 전달하는 reset 객체에 gedAvgScore 필드가 누락되어 있었습니다.
  • gedAvgScore는 스키마상 z.nullable(z.number()...)로 정의되어 있어 null은 허용하지만 undefined는 허용하지 않습니다. reset 객체에 포함되지 않은 필드는 RHF에 의해 undefined로 초기화되기 때문에, reset 직후 gedAvgScoreundefined 상태가 되어 step4Schema.safeParse()가 실패하고 isStep4Success가 계속 false로 고정되었습니다.
  • 이로 인해 다른 유형으로 전환한 뒤 폼을 빠짐없이 채워도 검증이 통과되지 못해 "내 성적 계산하기" 버튼이 영구적으로 비활성화 상태에 머무르게 됩니다.
  • handleBackClick의 reset 객체에 gedAvgScore: null을 추가하여, 유형 전환 시 폼이 정상적으로 valid 상태가 되도록 수정했습니다.

관련 이슈 🚨

모의 성적 계산하기 → 검정고시로 입력 후 "이전" → 다른 유형 선택 후 입력 시 "내 성적 계산하기" 버튼이 활성화되지 않는 문제
#410

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a handleBackClick function in CalculatePage to reset form values (including gedAvgScore to null) and clear error/graduation states when navigating back. The back button's click handler was updated to use this new function. The reviewer recommended also adding gedAvgScore: null to the defaultValues of the useForm declaration to ensure consistent initial state and prevent potential React warnings regarding uncontrolled-to-controlled inputs.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread apps/client/src/pageContainer/CalculatePage/index.tsx

@junjuny0227 junjuny0227 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@LeeSangHyeok0731 LeeSangHyeok0731 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다.

@s2yeons s2yeons merged commit b0f26d1 into develop Jun 9, 2026
2 checks passed
@s2yeons s2yeons deleted the fix/calculate-form-reset branch June 9, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants