From f286ffceb856db12ea3fa1bbbff8e994d94e8a62 Mon Sep 17 00:00:00 2001 From: manubo Date: Thu, 17 Oct 2019 09:34:00 +0200 Subject: [PATCH] Auto focus button in timer view --- src/js/components/App/TimerView.js | 2 +- src/js/components/Popup.js | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/js/components/App/TimerView.js b/src/js/components/App/TimerView.js index f907a63..16673f5 100644 --- a/src/js/components/App/TimerView.js +++ b/src/js/components/App/TimerView.js @@ -25,7 +25,7 @@ export default function TimerView({ timedActivity, onStopTimer }) { offset={timedActivity.seconds} style={{ fontSize: "36px", display: "inline-block" }} /> - diff --git a/src/js/components/Popup.js b/src/js/components/Popup.js index 03f9ab9..1d41d87 100644 --- a/src/js/components/Popup.js +++ b/src/js/components/Popup.js @@ -19,13 +19,6 @@ const Popup = forwardRef((props, ref) => { } useEffect(() => { - // Document might lose focus when clicking the browser action. - // Document might be out of focus when hitting the shortcut key. - // This puts the focus back to the document and ensures that: - // - the autofocus on the hours input field is triggered - // - the ESC key closes the popup without closing anything else - window.focus() - document.activeElement?.blur() window.addEventListener("message", handleMessage) return () => { window.removeEventListener("message", handleMessage)