mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
server input tweaks
This commit is contained in:
@@ -62,11 +62,16 @@ export default class DirInput extends React.Component<IProps, IState> {
|
||||
render() {
|
||||
return (
|
||||
<div className='DirInput'>
|
||||
<TextInput value={this.state.value} placeholder={this.state.placeholder} readOnly={true} onChange={(text: string) => {
|
||||
this.setState({ value: text })
|
||||
<TextInput
|
||||
value={this.state.value}
|
||||
placeholder={this.state.placeholder}
|
||||
clearable={true}
|
||||
readOnly={true} onChange={(text: string) => {
|
||||
this.setState({ value: text })
|
||||
|
||||
if (this.props.onChange) this.props.onChange(text)
|
||||
}}/>
|
||||
if (this.props.onChange) this.props.onChange(text)
|
||||
}}
|
||||
/>
|
||||
<div className="FileSelectIcon" onClick={this.handleIconClick}>
|
||||
<img src={File} />
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user