Skip to content

Commit

Permalink
Focus term when clicked on padding
Browse files Browse the repository at this point in the history
  • Loading branch information
LabhanshAgrawal committed Dec 26, 2022
1 parent bafa448 commit f355e31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/components/term.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ export default class Term extends React.PureComponent<TermProps> {
this.term.write(data);
}

focus() {
focus = () => {
this.term.focus();
}
};

clear() {
this.term.clear();
Expand Down Expand Up @@ -431,6 +431,7 @@ export default class Term extends React.PureComponent<TermProps> {
className={`term_fit ${this.props.isTermActive ? 'term_active' : ''}`}
style={{padding: this.props.padding}}
onMouseUp={this.onMouseUp}
onClick={this.focus}
>
{this.props.customChildrenBefore}
<div ref={this.onTermWrapperRef} className="term_fit term_wrapper" />
Expand Down

0 comments on commit f355e31

Please sign in to comment.