From 734bae293878f5b0de8fe8b3f7c18808e2130f3a Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Sun, 20 Jun 2021 18:54:54 +0530 Subject: [PATCH] Fix term focus on clicking header --- lib/containers/hyper.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/containers/hyper.tsx b/lib/containers/hyper.tsx index c5da9098..86bc9889 100644 --- a/lib/containers/hyper.tsx +++ b/lib/containers/hyper.tsx @@ -85,7 +85,13 @@ class Hyper extends React.PureComponent { onTermsRef = (terms: Terms) => { this.terms = terms; - window.focusActiveTerm = this.handleFocusActive; + window.focusActiveTerm = (uid?: string) => { + if (uid) { + this.handleFocusActive(uid); + } else { + this.terms.getActiveTerm().focus(); + } + }; }; componentWillUnmount() {