Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
fix: execute custom keyboard handlers when iframe has focus (#465)
Browse files Browse the repository at this point in the history
closes #464
  • Loading branch information
marionebl authored and Markus Ölhafen committed Jun 12, 2018
1 parent ca834a7 commit 9a6ebf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
8 changes: 1 addition & 7 deletions src/electron/create-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,7 @@ export function createMenu(ctx: MenuContext): void {
{
label: '&Delete',
enabled: typeof ctx.project !== 'undefined',
accelerator: (() => {
if (process.platform === 'darwin') {
return 'Backspace';
} else {
return 'Delete';
}
})(),
accelerator: process.platform === 'darwin' ? 'Backspace' : 'Delete',
click: () => {
Sender.send({
id: uuid.v4(),
Expand Down
5 changes: 2 additions & 3 deletions src/electron/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,8 @@ Sender.receive(message => {

// tslint:disable-next-line:cyclomatic-complexity
Sender.receive(message => {
// Do not perform custom operations
// if anything on the page has focus
if (document.activeElement !== document.body) {
// Do not perform custom operations when an input is selected
if (document.activeElement.tagName.toLowerCase() === 'input') {
return;
}

Expand Down

0 comments on commit 9a6ebf5

Please sign in to comment.