mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Fix term padding
This commit is contained in:
parent
062ef6b397
commit
502cdbb3b2
1 changed files with 13 additions and 6 deletions
|
|
@ -188,6 +188,12 @@ export default class Term extends React.PureComponent<TermProps> {
|
||||||
this.searchAddon = props.searchAddon!;
|
this.searchAddon = props.searchAddon!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.term.element!.style.padding = props.padding;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
this.fitAddon.fit();
|
this.fitAddon.fit();
|
||||||
|
|
||||||
if (this.props.isTermActive) {
|
if (this.props.isTermActive) {
|
||||||
|
|
@ -377,6 +383,12 @@ export default class Term extends React.PureComponent<TermProps> {
|
||||||
|
|
||||||
this.termOptions = nextTermOptions;
|
this.termOptions = nextTermOptions;
|
||||||
|
|
||||||
|
try {
|
||||||
|
this.term.element!.style.padding = this.props.padding;
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.props.fontSize !== prevProps.fontSize ||
|
this.props.fontSize !== prevProps.fontSize ||
|
||||||
this.props.fontFamily !== prevProps.fontFamily ||
|
this.props.fontFamily !== prevProps.fontFamily ||
|
||||||
|
|
@ -427,12 +439,7 @@ export default class Term extends React.PureComponent<TermProps> {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div
|
<div className={`term_fit ${this.props.isTermActive ? 'term_active' : ''}`} onMouseUp={this.onMouseUp}>
|
||||||
className={`term_fit ${this.props.isTermActive ? 'term_active' : ''}`}
|
|
||||||
style={{padding: this.props.padding}}
|
|
||||||
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" />
|
||||||
{this.props.customChildren}
|
{this.props.customChildren}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue