Check isComposing for send shortcut for IME users (#11)

* Check isComposing for send shortcut
This commit is contained in:
wang chenyu 2021-05-01 10:47:43 -07:00 committed by GitHub
parent 994a29263d
commit e960419b1e
2 changed files with 2 additions and 1 deletions

1
.gitignore vendored
View File

@ -12,3 +12,4 @@ public3
package-lock.json package-lock.json
session_name.session session_name.session
tasks.txt tasks.txt
yarn.lock

View File

@ -598,7 +598,7 @@ export const handleScrollSideEvent = (elem: HTMLElement, side: 'top' | 'bottom',
} */ } */
export function isSendShortcutPressed(e: KeyboardEvent) { export function isSendShortcutPressed(e: KeyboardEvent) {
if(e.key === 'Enter' && !isMobile) { if(e.key === 'Enter' && !isMobile && !e.isComposing) {
/* if(e.ctrlKey || e.metaKey) { /* if(e.ctrlKey || e.metaKey) {
this.messageInput.innerHTML += '<br>'; this.messageInput.innerHTML += '<br>';
placeCaretAtEnd(this.message) placeCaretAtEnd(this.message)