From e83fbed71c0ad0d8a3381694177fb34269668cc9 Mon Sep 17 00:00:00 2001 From: kjs Date: Wed, 3 Dec 2025 10:09:31 +0900 Subject: [PATCH] =?UTF-8?q?=EC=85=80=EB=A0=89=ED=8A=B8=20=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EC=B9=B4=ED=85=8C=EA=B3=A0=EB=A6=AC=20=EB=8B=A4?= =?UTF-8?q?=EB=A5=B8=EA=B0=92=20=EB=93=A4=EC=96=B4=EA=B0=80=EB=8A=94=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../select-basic/SelectBasicComponent.tsx | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/frontend/lib/registry/components/select-basic/SelectBasicComponent.tsx b/frontend/lib/registry/components/select-basic/SelectBasicComponent.tsx index d4ad416e..f19fafdc 100644 --- a/frontend/lib/registry/components/select-basic/SelectBasicComponent.tsx +++ b/frontend/lib/registry/components/select-basic/SelectBasicComponent.tsx @@ -732,16 +732,16 @@ const SelectBasicComponent: React.FC = ({
로딩 중...
) : allOptions.length > 0 ? ( allOptions.map((option, index) => { - const isSelected = selectedValues.includes(option.value); + const isOptionSelected = selectedValues.includes(option.value); return (
{ - const newVals = isSelected + const newVals = isOptionSelected ? selectedValues.filter((v) => v !== option.value) : [...selectedValues, option.value]; setSelectedValues(newVals); @@ -754,9 +754,21 @@ const SelectBasicComponent: React.FC = ({
{}} - className="h-4 w-4" + checked={isOptionSelected} + value={option.value} + onChange={(e) => { + // 체크박스 직접 클릭 시에도 올바른 값으로 처리 + e.stopPropagation(); + const newVals = isOptionSelected + ? selectedValues.filter((v) => v !== option.value) + : [...selectedValues, option.value]; + setSelectedValues(newVals); + const newValue = newVals.join(","); + if (isInteractive && onFormDataChange && component.columnName) { + onFormDataChange(component.columnName, newValue); + } + }} + className="h-4 w-4 pointer-events-auto" /> {option.label || option.value}