mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Fix Japanese input when sending a chat message (#9206)
GitOrigin-RevId: a1b65129e94735f0215ff2eaa9a8a36dd6093176
This commit is contained in:
parent
19db9c2583
commit
e103f736e1
1 changed files with 9 additions and 3 deletions
|
@ -8,12 +8,18 @@ function MessageInput({ resetUnreadMessages, sendMessage }) {
|
|||
if (event.key === 'Enter') {
|
||||
event.preventDefault()
|
||||
sendMessage(event.target.value)
|
||||
event.target.value = '' // clears the textarea content
|
||||
// wrap the form reset in setTimeout so input sources have time to finish
|
||||
// https://github.com/overleaf/internal/pull/9206
|
||||
window.setTimeout(() => {
|
||||
event.target.blur()
|
||||
event.target.closest('form').reset()
|
||||
event.target.focus()
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="new-message">
|
||||
<form className="new-message">
|
||||
<label htmlFor="chat-input" className="sr-only">
|
||||
{t('your_message')}
|
||||
</label>
|
||||
|
@ -23,7 +29,7 @@ function MessageInput({ resetUnreadMessages, sendMessage }) {
|
|||
onKeyDown={handleKeyDown}
|
||||
onClick={resetUnreadMessages}
|
||||
/>
|
||||
</div>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue