Skip to content

Commit 502cdbb

Browse files
Fix term padding
1 parent 062ef6b commit 502cdbb

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

lib/components/term.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ export default class Term extends React.PureComponent<TermProps> {
188188
this.searchAddon = props.searchAddon!;
189189
}
190190

191+
try {
192+
this.term.element!.style.padding = props.padding;
193+
} catch (error) {
194+
console.log(error);
195+
}
196+
191197
this.fitAddon.fit();
192198

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

378384
this.termOptions = nextTermOptions;
379385

386+
try {
387+
this.term.element!.style.padding = this.props.padding;
388+
} catch (error) {
389+
console.log(error);
390+
}
391+
380392
if (
381393
this.props.fontSize !== prevProps.fontSize ||
382394
this.props.fontFamily !== prevProps.fontFamily ||
@@ -427,12 +439,7 @@ export default class Term extends React.PureComponent<TermProps> {
427439

428440
render() {
429441
return (
430-
<div
431-
className={`term_fit ${this.props.isTermActive ? 'term_active' : ''}`}
432-
style={{padding: this.props.padding}}
433-
onMouseUp={this.onMouseUp}
434-
onClick={this.focus}
435-
>
442+
<div className={`term_fit ${this.props.isTermActive ? 'term_active' : ''}`} onMouseUp={this.onMouseUp}>
436443
{this.props.customChildrenBefore}
437444
<div ref={this.onTermWrapperRef} className="term_fit term_wrapper" />
438445
{this.props.customChildren}

0 commit comments

Comments
 (0)