Skip to content

Commit 4e7388e

Browse files
committed
fix(clipboard): copy/cut/paste
1 parent 7219ab5 commit 4e7388e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/BrowserViewProxy.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ export default class BrowserViewProxy {
3636
return this._webContents;
3737
}
3838

39+
static cut() {
40+
this._webContents.cut();
41+
}
42+
43+
static paste() {
44+
this._webContents.paste();
45+
}
46+
3947
static canGoBack() {
4048
return this._webContents.canGoBack();
4149
}

src/Electron/Component/BrowserViewComponent.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,7 @@ export default class WebViewComponent extends React.Component {
347347
menu.append(new MenuItem({
348348
label: 'Copy text',
349349
click: ()=>{
350-
//clipboard.writeText(data.text);
351-
webView.copy();
350+
clipboard.writeText(data.text);
352351
}
353352
}));
354353

0 commit comments

Comments
 (0)