| | |
| | | if (!/\n/ig.test(val)) { |
| | | this.props.onChange(val) |
| | | this.setState({value: val}) |
| | | if (!val) { |
| | | this.inputRef.current.focus() |
| | | } |
| | | } else { |
| | | val = val.replace(/\n/ig, '') |
| | | |
| | |
| | | const { config } = this.props |
| | | const { value } = this.state |
| | | |
| | | return <Input ref={this.inputRef} placeholder={config.placeholder || ''} value={value} autoComplete="off" disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleInputSubmit} /> |
| | | return <Input ref={this.inputRef} className="mk-form-input" allowClear placeholder={config.placeholder || ''} value={value} autoComplete="off" disabled={config.readonly} onChange={this.handleChange} onPressEnter={this.handleInputSubmit} /> |
| | | } |
| | | } |
| | | |