From: ajbura Date: Tue, 8 Feb 2022 11:57:57 +0000 (+0530) Subject: Fix edit message input not expending properly X-Git-Tag: v1.8.0~97 X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=a17d5d01a791f4131acc42549c84f755bc336c35;p=rainny.git Fix edit message input not expending properly Signed-off-by: ajbura --- diff --git a/src/app/molecules/message/Message.jsx b/src/app/molecules/message/Message.jsx index 16850f2..d3205d6 100644 --- a/src/app/molecules/message/Message.jsx +++ b/src/app/molecules/message/Message.jsx @@ -248,10 +248,8 @@ function MessageEdit({ body, onSave, onCancel }) { const editInputRef = useRef(null); useEffect(() => { - editInputRef.current.focus(); - - // Setting the value here instead of using the value prop below - // makes the cursor end up at the end of the line instead of the begining + // makes the cursor end up at the end of the line instead of the beginning + editInputRef.current.value = ''; editInputRef.current.value = body; }, []); @@ -267,9 +265,11 @@ function MessageEdit({ body, onSave, onCancel }) {