diff options
Diffstat (limited to 'src/client/views/EditableView.tsx')
-rw-r--r-- | src/client/views/EditableView.tsx | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index 4deed5ed9..4a986cb54 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -232,32 +232,22 @@ export class EditableView extends React.Component<EditableProps> { onChange: this.props.autosuggestProps.onChange, }} /> - ) : <EditableText - // oneLine={this.props.oneLine && this.props.GetValue()?.toString().indexOf('\n') === -1} - editing={true} - onEdit={function (newText: string): void { - throw new Error('Function not implemented.'); - } } - setEditing={function (editing: boolean): void { - throw new Error('Function not implemented.'); - } } - // onEdit={this.onChange} + ) : + <input + className="editableView-input" + ref={r => (this._inputref = r)} + style={{ display: this.props.display, overflow: 'auto', fontSize: this.props.fontSize, minWidth: 20, background: this.props.background }} + placeholder={this.props.placeholder} + onBlur={e => this.finalizeEdit(e.currentTarget.value, false, true, false)} + defaultValue={this.props.GetValue()} + autoFocus={true} + onChange={this.onChange} + onKeyDown={this.onKeyDown} + onKeyPress={this.stopPropagation} + onPointerDown={this.stopPropagation} + onClick={this.stopPropagation} + onPointerUp={this.stopPropagation} /> - // // <input - // // className="editableView-input" - // // ref={r => (this._inputref = r)} - // // style={{ display: this.props.display, overflow: 'auto', fontSize: this.props.fontSize, minWidth: 20, background: this.props.background }} - // // placeholder={this.props.placeholder} - // // onBlur={e => this.finalizeEdit(e.currentTarget.value, false, true, false)} - // // defaultValue={this.props.GetValue()} - // // autoFocus={true} - // // onChange={this.onChange} - // // onKeyDown={this.onKeyDown} - // // onKeyPress={this.stopPropagation} - // // onPointerDown={this.stopPropagation} - // // onClick={this.stopPropagation} - // // onPointerUp={this.stopPropagation} - // // /> // ) : ( // <textarea // className="editableView-input" |