mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 18:43:41 -05:00
web/composer: fix scrolling to bottom when starting to reply
This commit is contained in:
parent
f0cb397316
commit
f3da677565
1 changed files with 3 additions and 1 deletions
|
@ -384,7 +384,9 @@ const MessageComposer = () => {
|
|||
textRows.current = newTextRows
|
||||
// This has to be called unconditionally, because setting rows = 1 messes up the scroll state otherwise
|
||||
roomCtx.scrollToBottom()
|
||||
}, [state.text, roomCtx])
|
||||
// scrollToBottom needs to be called when replies/attachments/etc change,
|
||||
// so listen to state instead of only state.text
|
||||
}, [state, roomCtx])
|
||||
// Saving to localStorage could be done in the reducer, but that's not very proper, so do it in an effect.
|
||||
useEffect(() => {
|
||||
roomCtx.isEditing.emit(editing !== null)
|
||||
|
|
Loading…
Add table
Reference in a new issue