diff options
author | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-06-12 16:33:08 -0500 |
---|---|---|
committer | anika-ahluwalia <anika.ahluwalia@gmail.com> | 2020-06-12 16:33:08 -0500 |
commit | 35d6f64256500494d044846be65142694dfff4ac (patch) | |
tree | 6508e9428e13f45cd639cdf3c9e86609c1c582f9 /src/client/views/EditableView.tsx | |
parent | ed6780f7a16e76165bbfc4dbcefe2d77ea40581c (diff) |
changes to UI and slight bux fixes
Diffstat (limited to 'src/client/views/EditableView.tsx')
-rw-r--r-- | src/client/views/EditableView.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/views/EditableView.tsx b/src/client/views/EditableView.tsx index 4f3da70d7..fafc30625 100644 --- a/src/client/views/EditableView.tsx +++ b/src/client/views/EditableView.tsx @@ -50,6 +50,7 @@ export interface EditableProps { toggle?: () => void; color?: string | undefined; onDrop?: any; + placeholder?: string; } /** @@ -177,6 +178,7 @@ export class EditableView extends React.Component<EditableProps> { onBlur={e => this.finalizeEdit(e.currentTarget.value, false, true)} onPointerDown={this.stopPropagation} onClick={this.stopPropagation} onPointerUp={this.stopPropagation} style={{ display: this.props.display, fontSize: this.props.fontSize }} + placeholder={this.props.placeholder} />; } else { this.props.autosuggestProps?.resetValue(); @@ -184,8 +186,9 @@ export class EditableView extends React.Component<EditableProps> { <div className={`editableView-container-editing${this.props.oneLine ? "-oneLine" : ""}`} ref={this._ref} style={{ display: this.props.display, minHeight: "20px", height: `${this.props.height ? this.props.height : "auto"}`, maxHeight: `${this.props.maxHeight}` }} - onClick={this.onClick}> - <span style={{ fontStyle: this.props.fontStyle, fontSize: this.props.fontSize }}>{this.props.contents}</span> + onClick={this.onClick} placeholder={this.props.placeholder}> + + <span style={{ fontStyle: this.props.fontStyle, fontSize: this.props.fontSize, color: this.props.contents ? "black" : "grey" }}>{this.props.contents ? this.props.contents?.valueOf() : this.props.placeholder?.valueOf()}</span> </div> ); } |