diff --git a/client/src/components/Design/components/Input/Input.tsx b/client/src/components/Design/components/Input/Input.tsx index 08d879c6a..97b64a132 100644 --- a/client/src/components/Design/components/Input/Input.tsx +++ b/client/src/components/Design/components/Input/Input.tsx @@ -14,7 +14,7 @@ export const Input: React.FC = forwardRef) => { - if (event.key === 'Enter' && canAddMembers) { + if (event.key === 'Enter' && canAddMembers && inputRef.current) { + event.preventDefault(); if (!billInfo.members.map(({name}) => name).includes(nameInput)) { setBillInfoMemberWithId(nameInput); - } - setNameInput(''); - if (inputRef.current) { + setNameInput(''); + inputRef.current.value = ''; inputRef.current.blur(); setTimeout(() => { - inputRef.current?.focus(); - }, 0); - } - if (event.nativeEvent.isComposing) { - return; + if (inputRef.current) inputRef.current?.focus(); + }, 10); } } };