Skip to content

Commit f6059ef

Browse files
committed
Focus on editor upon page loading
1 parent e3fa4ef commit f6059ef

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

web/pages/messages/[channelId].tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ export const PrivateChat = (props: {
145145
placeholder: 'Send a message',
146146
})
147147

148+
useEffect(() => {
149+
if (editor) {
150+
editor.commands.focus()
151+
}
152+
}, [editor])
153+
148154
useEffect(() => {
149155
setAsSeen(channelId)
150156
}, [JSON.stringify(messages)])

0 commit comments

Comments
 (0)