fix: 다중 선택 컴포넌트 기타 선택 초기화 값 변경
This commit is contained in:
parent
c769d9b533
commit
d00fae684b
@ -530,7 +530,7 @@ const MultiCheck = ({
|
|||||||
|
|
||||||
/** 다중 선택 처리 */
|
/** 다중 선택 처리 */
|
||||||
const handleCheckbox = (item: { id: number; code: string | null; name: string }) => {
|
const handleCheckbox = (item: { id: number; code: string | null; name: string }) => {
|
||||||
const isOtherSelected = Boolean(etcValue)
|
const isOtherSelected = etcValue !== null
|
||||||
let newValue: string[]
|
let newValue: string[]
|
||||||
|
|
||||||
if (selectedValues.includes(item.code ?? String(item.id))) {
|
if (selectedValues.includes(item.code ?? String(item.id))) {
|
||||||
@ -556,7 +556,7 @@ const MultiCheck = ({
|
|||||||
|
|
||||||
if (isRoofMaterial) {
|
if (isRoofMaterial) {
|
||||||
/** 지붕 재료 기타 선택 포함 최대 2개 선택 처리 */
|
/** 지붕 재료 기타 선택 포함 최대 2개 선택 처리 */
|
||||||
if (selectedValues.length >= 2) {
|
if (!isOtherSelected && selectedValues.length >= 2) {
|
||||||
showErrorAlert(WARNING_MESSAGE.ROOF_MATERIAL_MAX_SELECT)
|
showErrorAlert(WARNING_MESSAGE.ROOF_MATERIAL_MAX_SELECT)
|
||||||
setEtcValue(null)
|
setEtcValue(null)
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user