Skip to content

Commit

Permalink
Fix cut and paste for webviews (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef authored and sindresorhus committed Apr 30, 2019
1 parent b1c8b31 commit e1e4061
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -46,7 +46,7 @@ const create = (win, options) => {
click(menuItem) {
props.selectionText = menuItem.transform ? menuItem.transform(props.selectionText) : props.selectionText;
electron.clipboard.writeText(props.selectionText);
win.webContents.delete();
webContents(win).delete();
}
}),
copy: decorateMenuItem({
Expand All @@ -67,7 +67,7 @@ const create = (win, options) => {
click(menuItem) {
let clipboardContent = electron.clipboard.readText(props.selectionText);
clipboardContent = menuItem.transform ? menuItem.transform(clipboardContent) : clipboardContent;
win.webContents.insertText(clipboardContent);
webContents(win).insertText(clipboardContent);
}
}),
inspect: () => ({
Expand Down

0 comments on commit e1e4061

Please sign in to comment.