Browse Source

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

* Check isComposing for send shortcut
master
wang chenyu 4 years ago committed by GitHub
parent
commit
e960419b1e
  1. 1
      .gitignore
  2. 2
      src/helpers/dom.ts

1
.gitignore vendored

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

2
src/helpers/dom.ts

@ -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)

Loading…
Cancel
Save