Skip to content

Commit

Permalink
Stop dispatching to keybindings in editing coposition text.
Browse files Browse the repository at this point in the history
Signed-off-by: Masaki Muranaka <monaka@monami-ya.com>
  • Loading branch information
monaka committed Dec 2, 2019
1 parent c4b4d39 commit 4588241
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/core/src/browser/frontend-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,30 @@ export class FrontendApplication {
return startupElements.length === 0 ? undefined : startupElements[0] as HTMLElement;
}

protected inComposition = false;

/**
* Register global event listeners.
*/
protected registerEventListeners(): void {
window.document.addEventListener('compositionstart', event => {
this.inComposition = true;
});
window.document.addEventListener('compositionend', event => {
this.inComposition = false;
});

window.addEventListener('beforeunload', () => {
this.stateService.state = 'closing_window';
this.layoutRestorer.storeLayout(this);
this.stopContributions();
});
window.addEventListener('resize', () => this.shell.update());
document.addEventListener('keydown', event => this.keybindings.run(event), true);
document.addEventListener('keydown', event => {
if (this.inComposition !== true) {
this.keybindings.run(event);
}
}, true);
document.addEventListener('touchmove', event => { event.preventDefault(); }, { passive: false });
// Prevent forward/back navigation by scrolling in OS X
if (isOSX) {
Expand Down

0 comments on commit 4588241

Please sign in to comment.