Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop dispatching to keybindings in editing coposition text. #6673

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 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,42 @@ export class FrontendApplication {
return startupElements.length === 0 ? undefined : startupElements[0] as HTMLElement;
}

/* vvv HOTFIX begin vvv
*
* This is a hotfix against issues eclipse/theia#6459 and gitpod-io/gitpod#875 .
* It should be reverted after Theia was updated to the newer Monaco.
*/
protected inComposition = false;
monaka marked this conversation as resolved.
Show resolved Hide resolved
/**
* Register composition related event listeners.
*/
protected registerComositionEventListeners(): void {
window.document.addEventListener('compositionstart', event => {
this.inComposition = true;
});
window.document.addEventListener('compositionend', event => {
this.inComposition = false;
});
}
/* ^^^ HOTFIX end ^^^ */

/**
* Register global event listeners.
*/
protected registerEventListeners(): void {
this.registerComositionEventListeners(); /* Hotfix. See above. */

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