fix: 다중 선택 컴포넌트 기타 선택 초기화 값 변경

This commit is contained in:
Dayoung 2025-08-06 13:43:03 +09:00
parent c769d9b533
commit d00fae684b

View File

@ -530,7 +530,7 @@ const MultiCheck = ({
/** 다중 선택 처리 */
const handleCheckbox = (item: { id: number; code: string | null; name: string }) => {
const isOtherSelected = Boolean(etcValue)
const isOtherSelected = etcValue !== null
let newValue: string[]
if (selectedValues.includes(item.code ?? String(item.id))) {
@ -556,7 +556,7 @@ const MultiCheck = ({
if (isRoofMaterial) {
/** 지붕 재료 기타 선택 포함 최대 2개 선택 처리 */
if (selectedValues.length >= 2) {
if (!isOtherSelected && selectedValues.length >= 2) {
showErrorAlert(WARNING_MESSAGE.ROOF_MATERIAL_MAX_SELECT)
setEtcValue(null)
return