diff options
author | bobzel <zzzman@gmail.com> | 2025-04-21 13:48:58 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-04-21 13:48:58 -0400 |
commit | 17e24e780b54f2f7015c0ca955c3aa5091bba19c (patch) | |
tree | b13002c92d58cb52a02b46e4e1d578f1d57125f2 /src/client/views/EditableView.tsx | |
parent | 22a40443193320487c27ce02bd3f134d13cb7d65 (diff) | |
parent | 1f294ef4a171eec72a069a9503629eaf7975d983 (diff) |
merged with master and cleaned up outpainting a bit.
Diffstat (limited to 'src/client/views/EditableView.tsx')
-rw-r--r-- | src/client/views/EditableView.tsx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index e2490cec8..d9447b7ec 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -287,8 +287,8 @@ export class EditableView extends ObservableReactComponent<EditableProps> { staticDisplay = () => { let toDisplay; - const gval = this._props.GetValue()?.replace(/\n/g, '\\r\\n'); if (this._props.inputString) { + const gval = this._props.GetValue()?.replace(/\n/g, '\\r\\n'); toDisplay = ( <input className="editableView-input" @@ -315,15 +315,17 @@ export class EditableView extends ObservableReactComponent<EditableProps> { }; render() { - const gval = this._props.GetValue()?.replace(/\n/g, '\\r\\n'); - if (this._editing && gval !== undefined) { - return this._props.sizeToContent ? ( - <div style={{ display: 'grid', minWidth: 100 }}> - <div style={{ display: 'inline-block', position: 'relative', height: 0, width: '100%', overflow: 'hidden' }}>{this.renderEditor()}</div> - </div> - ) : ( - this.renderEditor() - ); + if (this._editing) { + const gval = this._props.GetValue()?.replace(/\n/g, '\\r\\n'); + if (gval !== undefined) { + return this._props.sizeToContent ? ( + <div style={{ display: 'grid', minWidth: 100 }}> + <div style={{ display: 'inline-block', position: 'relative', height: 0, width: '100%', overflow: 'hidden' }}>{this.renderEditor()}</div> + </div> + ) : ( + this.renderEditor() + ); + } } setTimeout(() => this._props.autosuggestProps?.resetValue()); return ( |