Skip to content

Commit 9d85db5

Browse files
committed
fix: editing usage
1 parent 2e2248e commit 9d85db5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

package/src/components/MessageInput/MessageInput.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,10 @@ const MessageInputWithContext = (props: MessageInputPropsWithContext) => {
274274
);
275275

276276
useEffect(() => {
277-
const { editedMessage } = messageComposer;
278-
if (editedMessage && inputBoxRef.current) {
277+
if (editing && inputBoxRef.current) {
279278
inputBoxRef.current.focus();
280279
}
281-
}, [messageComposer, inputBoxRef]);
280+
}, [messageComposer, inputBoxRef, editing]);
282281

283282
// Effect to create draft whenever we un-mount the component.
284283
useEffect(

0 commit comments

Comments
 (0)