diff options
author | 2020-04-21 01:48:18 +0530 | |
---|---|---|
committer | 2020-04-20 20:18:18 +0000 | |
commit | 4706721bfc1ad341c1775400f27d6a943265d188 (patch) | |
tree | 97facab3fcb5a354584fefd5357767b192c5ad30 /src/components/services | |
parent | docs: add mahadevans87 as a contributor (#612) (diff) | |
download | ferdium-app-4706721bfc1ad341c1775400f27d6a943265d188.tar.gz ferdium-app-4706721bfc1ad341c1775400f27d6a943265d188.tar.zst ferdium-app-4706721bfc1ad341c1775400f27d6a943265d188.zip |
Refocus Webview only for active service (#610)
* Fix: Refocus Webview only for active service
- add check to identify if the webview belongs to the active service during refocussing a webview.
- blur and focus the webview only for the active service.
Co-Authored-By: Sampath Kumar Krishnan <sampathblam@users.noreply.github.com>
* fix: Focus on Active Service
- replace document.activeElement.blur() with service.webview.blur()
Co-Authored-By: Sampath Kumar Krishnan <sampathblam@users.noreply.github.com>
* refactor
- lint fixes
Co-Authored-By: Sampath Kumar Krishnan <sampathblam@users.noreply.github.com>
Co-authored-by: Sampath Kumar Krishnan <sampathblam@users.noreply.github.com>
Diffstat (limited to 'src/components/services')
-rw-r--r-- | src/components/services/content/ServiceWebview.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/components/services/content/ServiceWebview.js b/src/components/services/content/ServiceWebview.js index 652647470..210a6ab6b 100644 --- a/src/components/services/content/ServiceWebview.js +++ b/src/components/services/content/ServiceWebview.js | |||
@@ -41,9 +41,14 @@ class ServiceWebview extends Component { | |||
41 | 41 | ||
42 | refocusWebview = () => { | 42 | refocusWebview = () => { |
43 | const { webview } = this; | 43 | const { webview } = this; |
44 | debug('Refocus Webview is called', this.props.service); | ||
44 | if (!webview) return; | 45 | if (!webview) return; |
45 | webview.view.blur(); | 46 | if (this.props.service.isActive) { |
46 | webview.view.focus(); | 47 | webview.view.blur(); |
48 | webview.view.focus(); | ||
49 | } else { | ||
50 | debug('Refocus not required - Not active service'); | ||
51 | } | ||
47 | }; | 52 | }; |
48 | 53 | ||
49 | render() { | 54 | render() { |