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

fix: execute custom keyboard handlers when iframe has focus #465

Merged
merged 2 commits into from
May 27, 2018
Merged
Show file tree
Hide file tree
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
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