Skip to content

Commit b255572

Browse files
authored
Merge pull request #309 from itTkm/fix/278
fix #278 Handle the send message event on Enter key press
2 parents e1e2c99 + 0dc88f5 commit b255572

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/lib/Room/RoomFooter/RoomFooter.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,20 +331,23 @@ export default {
331331
332332
mounted() {
333333
const isMobile = detectMobile()
334+
let isComposed = true
334335
335336
this.getTextareaRef().addEventListener('keyup', e => {
336337
if (e.key === 'Enter' && !e.shiftKey && !this.fileDialog) {
337338
if (isMobile) {
338339
this.message = this.message + '\n'
339340
setTimeout(() => this.onChangeInput())
340341
} else if (
342+
isComposed &&
341343
!this.filteredEmojis.length &&
342344
!this.filteredUsersTag.length &&
343345
!this.filteredTemplatesText.length
344346
) {
345347
this.sendMessage()
346348
}
347349
}
350+
isComposed = !e.isComposing
348351
349352
setTimeout(() => {
350353
this.updateFooterLists()

0 commit comments

Comments
 (0)