From 94f0d142c76928d532512c183e3c6439ceefa2cb Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 17 Sep 2021 02:40:54 -0400 Subject: [PATCH] Fix chat input width resetting --- src/views/room/widgets/chat-input/ChatInputView.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/views/room/widgets/chat-input/ChatInputView.tsx b/src/views/room/widgets/chat-input/ChatInputView.tsx index c1ac2a3b..534dd93c 100644 --- a/src/views/room/widgets/chat-input/ChatInputView.tsx +++ b/src/views/room/widgets/chat-input/ChatInputView.tsx @@ -260,11 +260,18 @@ export const ChatInputView: FC<{}> = props => } }, [ onKeyDownEvent ]); + useEffect(() => + { + if(!inputRef.current) return; + + inputRef.current.parentElement.dataset.value = chatValue; + }, [ chatValue ]); + return ( createPortal(
- { event.target.parentElement.dataset.value = event.target.value; updateChatInput(event.target.value) } } onMouseDown={ event => setInputFocus() } /> + updateChatInput(event.target.value) } onMouseDown={ event => setInputFocus() } />
, document.getElementById('toolbar-chat-input-container'))