크롬에서 엔터를 칠 때 채팅이 두 번 가는 문제를 막으려면 ChatBox의 onKeydownChat 코드를 다음과 같이 수정하세요. 관련 링크입니다.
https://velog.io/@o1_choi/isComposing
const onKeydownChat = useCallback((e) => {
if (!e.nativeEvent.isComposing && e.key === 'Enter') {
if (!e.shiftKey) {
e.preventDefault();
onSubmitForm(e);
}
}
}, [onSubmitForm]);
Chanhyung Lee님 감사합니다.