diff options
author | 2019-10-03 15:10:01 +0200 | |
---|---|---|
committer | 2019-10-03 15:10:01 +0200 | |
commit | ecb1399dc2f2d7532ee01ba9774c3ac1f7b8bbeb (patch) | |
tree | 604a41e87d26025fbdc80c5468cdec4d65bde2ad /src/components | |
parent | Merge pull request #1642 from meetfranz/fix/clear-confetti-timeout (diff) | |
parent | Add workaround for electron webview issue with disappearing cursors (diff) | |
download | ferdium-app-ecb1399dc2f2d7532ee01ba9774c3ac1f7b8bbeb.tar.gz ferdium-app-ecb1399dc2f2d7532ee01ba9774c3ac1f7b8bbeb.tar.zst ferdium-app-ecb1399dc2f2d7532ee01ba9774c3ac1f7b8bbeb.zip |
fix(Service): Fix disappearing cursor in services
Workaround for disappearing cursors in webviews
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 07bd17d9c..b3198d36a 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -20,6 +20,13 @@ class ServiceWebview extends Component { | |||
20 | detachService({ service }); | 20 | detachService({ service }); |
21 | } | 21 | } |
22 | 22 | ||
23 | refocusWebview = () => { | ||
24 | const { webview } = this; | ||
25 | if (!webview) return; | ||
26 | webview.view.blur(); | ||
27 | webview.view.focus(); | ||
28 | }; | ||
29 | |||
23 | render() { | 30 | render() { |
24 | const { | 31 | const { |
25 | service, | 32 | service, |
@@ -28,7 +35,10 @@ class ServiceWebview extends Component { | |||
28 | 35 | ||
29 | return ( | 36 | return ( |
30 | <ElectronWebView | 37 | <ElectronWebView |
31 | ref={(webview) => { this.webview = webview; }} | 38 | ref={(webview) => { |
39 | this.webview = webview; | ||
40 | webview.view.addEventListener('did-stop-loading', this.refocusWebview); | ||
41 | }} | ||
32 | autosize | 42 | autosize |
33 | src={service.url} | 43 | src={service.url} |
34 | preload="./webview/recipe.js" | 44 | preload="./webview/recipe.js" |