From 4706721bfc1ad341c1775400f27d6a943265d188 Mon Sep 17 00:00:00 2001 From: Mahadevan Sreenivasan Date: Tue, 21 Apr 2020 01:48:18 +0530 Subject: 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 * fix: Focus on Active Service - replace document.activeElement.blur() with service.webview.blur() Co-Authored-By: Sampath Kumar Krishnan * refactor - lint fixes Co-Authored-By: Sampath Kumar Krishnan Co-authored-by: Sampath Kumar Krishnan --- src/components/services/content/ServiceWebview.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/components/services/content/ServiceWebview.js') 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 { refocusWebview = () => { const { webview } = this; + debug('Refocus Webview is called', this.props.service); if (!webview) return; - webview.view.blur(); - webview.view.focus(); + if (this.props.service.isActive) { + webview.view.blur(); + webview.view.focus(); + } else { + debug('Refocus not required - Not active service'); + } }; render() { -- cgit v1.2.3-54-g00ecf