Skip to content

Commit

Permalink
Fix term padding
Browse files Browse the repository at this point in the history
  • Loading branch information
LabhanshAgrawal committed Dec 31, 2022
1 parent 062ef6b commit 502cdbb
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/components/term.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,12 @@ export default class Term extends React.PureComponent<TermProps> {
this.searchAddon = props.searchAddon!;
}

try {
this.term.element!.style.padding = props.padding;
} catch (error) {
console.log(error);
}

this.fitAddon.fit();

if (this.props.isTermActive) {
Expand Down Expand Up @@ -377,6 +383,12 @@ export default class Term extends React.PureComponent<TermProps> {

this.termOptions = nextTermOptions;

try {
this.term.element!.style.padding = this.props.padding;
} catch (error) {
console.log(error);
}

if (
this.props.fontSize !== prevProps.fontSize ||
this.props.fontFamily !== prevProps.fontFamily ||
Expand Down Expand Up @@ -427,12 +439,7 @@ export default class Term extends React.PureComponent<TermProps> {

render() {
return (
<div
className={`term_fit ${this.props.isTermActive ? 'term_active' : ''}`}
style={{padding: this.props.padding}}
onMouseUp={this.onMouseUp}
onClick={this.focus}
>
<div className={`term_fit ${this.props.isTermActive ? 'term_active' : ''}`} onMouseUp={this.onMouseUp}>
{this.props.customChildrenBefore}
<div ref={this.onTermWrapperRef} className="term_fit term_wrapper" />
{this.props.customChildren}
Expand Down

0 comments on commit 502cdbb

Please sign in to comment.