Use onChange instead of onInput
This commit is contained in:
parent
20f79f1da5
commit
9ad3b53f7c
2 changed files with 4 additions and 7 deletions
|
@ -81,7 +81,7 @@ class Console extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onInput(e) {
|
onChange(e) {
|
||||||
let text = e.target.value;
|
let text = e.target.value;
|
||||||
this.props.dispatch(consoleActions.setConsoleText(text));
|
this.props.dispatch(consoleActions.setConsoleText(text));
|
||||||
if (this.props.mode === 'command') {
|
if (this.props.mode === 'command') {
|
||||||
|
@ -118,7 +118,7 @@ class Console extends React.Component {
|
||||||
mode={this.props.mode}
|
mode={this.props.mode}
|
||||||
onBlur={this.onBlur.bind(this)}
|
onBlur={this.onBlur.bind(this)}
|
||||||
onKeyDown={this.onKeyDown.bind(this)}
|
onKeyDown={this.onKeyDown.bind(this)}
|
||||||
onInput={this.onInput.bind(this)}
|
onChange={this.onChange.bind(this)}
|
||||||
value={this.props.consoleText}
|
value={this.props.consoleText}
|
||||||
/>
|
/>
|
||||||
</div>;
|
</div>;
|
||||||
|
@ -140,9 +140,6 @@ class Console extends React.Component {
|
||||||
|
|
||||||
Console.propTypes = {
|
Console.propTypes = {
|
||||||
mode: PropTypes.string,
|
mode: PropTypes.string,
|
||||||
onBlur: PropTypes.func,
|
|
||||||
onKeyDown: PropTypes.func,
|
|
||||||
onInput: PropTypes.func,
|
|
||||||
consoleText: PropTypes.string,
|
consoleText: PropTypes.string,
|
||||||
messageText: PropTypes.string,
|
messageText: PropTypes.string,
|
||||||
children: PropTypes.string,
|
children: PropTypes.string,
|
||||||
|
|
|
@ -24,7 +24,7 @@ class Input extends React.Component {
|
||||||
ref={(c) => { this.input = c; }}
|
ref={(c) => { this.input = c; }}
|
||||||
onBlur={this.props.onBlur}
|
onBlur={this.props.onBlur}
|
||||||
onKeyDown={this.props.onKeyDown}
|
onKeyDown={this.props.onKeyDown}
|
||||||
onInput={this.props.onInput}
|
onChange={this.props.onChange}
|
||||||
value={this.props.value}
|
value={this.props.value}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,7 +37,7 @@ Input.propTypes = {
|
||||||
value: PropTypes.string,
|
value: PropTypes.string,
|
||||||
onBlur: PropTypes.func,
|
onBlur: PropTypes.func,
|
||||||
onKeyDown: PropTypes.func,
|
onKeyDown: PropTypes.func,
|
||||||
onInput: PropTypes.func,
|
onChange: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Input;
|
export default Input;
|
||||||
|
|
Reference in a new issue