server input tweaks

This commit is contained in:
SpikeHD
2022-05-16 17:23:13 -07:00
parent 38b4ab4f5d
commit 5c0a46b2d2
3 changed files with 24 additions and 12 deletions

View File

@@ -42,13 +42,16 @@ export default class TextInput extends React.Component<IProps, IState> {
this.setState({ value: e.target.value })
if (this.props.onChange) this.props.onChange(e.target.value)
}} />
<div className="TextClear" onClick={() => {
this.setState({ value: '' })
if (this.props.onChange) this.props.onChange('')
}}>
<img src={Close} className="TextInputClear" />
</div>
{
this.props.clearable ?
<div className="TextClear" onClick={() => {
this.setState({ value: '' })
if (this.props.onChange) this.props.onChange('')
}}>
<img src={Close} className="TextInputClear" />
</div> : null
}
</div>
)
}