Focus term when clicked on padding

This commit is contained in:
Labhansh Agrawal 2022-12-26 13:20:30 +05:30
parent bafa44845a
commit f355e31a80

View file

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