From f355e31a80ce32008e10b69b19f464f7588b9010 Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Mon, 26 Dec 2022 13:20:30 +0530 Subject: [PATCH] Focus term when clicked on padding --- lib/components/term.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/components/term.tsx b/lib/components/term.tsx index 16846184..80fd48ea 100644 --- a/lib/components/term.tsx +++ b/lib/components/term.tsx @@ -284,9 +284,9 @@ export default class Term extends React.PureComponent { this.term.write(data); } - focus() { + focus = () => { this.term.focus(); - } + }; clear() { this.term.clear(); @@ -431,6 +431,7 @@ export default class Term extends React.PureComponent { className={`term_fit ${this.props.isTermActive ? 'term_active' : ''}`} style={{padding: this.props.padding}} onMouseUp={this.onMouseUp} + onClick={this.focus} > {this.props.customChildrenBefore}