Skip to content

Commit

Permalink
feat: mailmodal 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
seung365 committed Aug 2, 2024
1 parent b47edb6 commit f01114a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/components/Mail/MailModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,12 @@ export const MailModal = ({ isOpen, onClose }: MailModalProps) => {
};

const handleKeyDown = async (event: React.KeyboardEvent<HTMLInputElement>) => {
if (event.key === 'Enter') {
if (event.key === 'Enter' && content) {
event.preventDefault();
const inputValue = (event.target as HTMLInputElement).value;

if (currentIndex === 0) {
const combinedValue = `${firstInput} ${inputValue}`.trim();
await setValue(inputNames[currentIndex], combinedValue, { shouldValidate: true });
console.log(combinedValue);
}

const combinedValue = `${firstInput} ${inputValue}`.trim();
await setValue(inputNames[currentIndex], combinedValue, { shouldValidate: true });
console.log(combinedValue);
await handleNextClick();
}
};
Expand Down

0 comments on commit f01114a

Please sign in to comment.