| | |
| | | |
| | | handleChange = (e) => { |
| | | let val = e.target.value |
| | | let submit = /\n/ig.test(val) |
| | | let submit = /\n/g.test(val) |
| | | |
| | | val = val.replace(/\n/ig, '') |
| | | if (submit) { |
| | | val = val.replace(/\n|'/g, '') |
| | | } |
| | | |
| | | if (submit && /^\s+$/.test(val)) { |
| | | submit = false |
| | | } |
| | | |
| | | let _val = val |
| | | |
| | |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit() |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | } |
| | | |
| | |
| | | const { config } = this.props |
| | | const { value } = this.state |
| | | |
| | | if (config.inputType === 'password') { |
| | | return <Input.Password ref={this.inputRef} className="mk-form-input" 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} /> |
| | | } |
| | | } |