= ({
{mode === '생성' && (
-
- )}
-
- {/* mode가 '수정'일 때도 보이도록 */}
- {mode === '수정' && (
-
-
+ <>
-
+
+
+
+
+
+
+
+
+ >
)}
-
-
-
-
-
-
-
+ {/* mode가 '수정'일 때도 보이도록 */}
+ {mode === '수정' && (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+ >
+ )}
diff --git a/src/components/ui/ModalInput/ModalDropdown.tsx b/src/components/ui/ModalInput/ModalDropdown.tsx
index 871614e..e38217c 100644
--- a/src/components/ui/ModalInput/ModalDropdown.tsx
+++ b/src/components/ui/ModalInput/ModalDropdown.tsx
@@ -80,7 +80,6 @@ export default function ModalDropdown({
}: ModalDropdownProps) {
const [open, setOpen] = useState(false);
const [options, setOptions] = useState(data);
-
const [selectedOption, setSelectedOption] = useState(
data.find((item) => item.id === currentId),
);
@@ -93,15 +92,18 @@ export default function ModalDropdown({
setOptions(data);
}, [data]);
+ useEffect(() => {
+ setSelectedOption(data.find((item) => item.id === currentId));
+ }, [options]);
+
const handleClose = () => {
setOpen(false);
};
// 담당자 이름 검색 기능
const handleInputChange = (event: ChangeEvent) => {
- const filteredData = data.filter(
- (datum) =>
- 'nickname' in datum && datum?.nickname?.includes(event.target.value),
+ const filteredData = data.filter((datum) =>
+ datum?.nickname?.includes(event.target.value),
);
setOptions([...filteredData]);
};
@@ -158,7 +160,6 @@ export default function ModalDropdown({
/>
)}
-
{label === '담당자' ? (
입력
diff --git a/src/components/ui/ModalInput/inputClassNames.ts b/src/components/ui/ModalInput/inputClassNames.ts
index f3d67f7..506285a 100644
--- a/src/components/ui/ModalInput/inputClassNames.ts
+++ b/src/components/ui/ModalInput/inputClassNames.ts
@@ -11,6 +11,7 @@ export const inputClassNames = {
type: {
dropdown: 'h-12 w-[217px]',
input: 'h-12 w-[450px]',
- textarea: 'min-h-[110px] w-[450px] sm:w-[287px] sm:min-h-[70px]',
+ textarea:
+ 'min-h-[110px] w-[450px] md:w-[420px] sm:w-[287px] sm:min-h-[70px]',
},
};
diff --git a/src/components/ui/ModalWrapper.tsx b/src/components/ui/ModalWrapper.tsx
index 6633eed..19dd74d 100644
--- a/src/components/ui/ModalWrapper.tsx
+++ b/src/components/ui/ModalWrapper.tsx
@@ -40,7 +40,7 @@ function ModalWrapper({ children, id, onRemove }: Props) {
}, [id]);
return (
-