diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-04-30 09:58:21 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2019-04-30 09:58:21 +0900 |
commit | 9ad3b53f7cb7986275476b4c03b1f94959cdcc37 (patch) | |
tree | 417aacac4938a85d180b69c292efbf295cc9c2e8 /src | |
parent | 20f79f1da54441fe22a172009d34734af1bd3807 (diff) |
Use onChange instead of onInput
Diffstat (limited to 'src')
-rw-r--r-- | src/console/components/Console.jsx | 7 | ||||
-rw-r--r-- | src/console/components/console/Input.jsx | 4 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/console/components/Console.jsx b/src/console/components/Console.jsx index 6a9cebd..5427e43 100644 --- a/src/console/components/Console.jsx +++ b/src/console/components/Console.jsx @@ -81,7 +81,7 @@ class Console extends React.Component { } } - onInput(e) { + onChange(e) { let text = e.target.value; this.props.dispatch(consoleActions.setConsoleText(text)); if (this.props.mode === 'command') { @@ -118,7 +118,7 @@ class Console extends React.Component { mode={this.props.mode} onBlur={this.onBlur.bind(this)} onKeyDown={this.onKeyDown.bind(this)} - onInput={this.onInput.bind(this)} + onChange={this.onChange.bind(this)} value={this.props.consoleText} /> </div>; @@ -140,9 +140,6 @@ class Console extends React.Component { Console.propTypes = { mode: PropTypes.string, - onBlur: PropTypes.func, - onKeyDown: PropTypes.func, - onInput: PropTypes.func, consoleText: PropTypes.string, messageText: PropTypes.string, children: PropTypes.string, diff --git a/src/console/components/console/Input.jsx b/src/console/components/console/Input.jsx index c85d252..cbd3348 100644 --- a/src/console/components/console/Input.jsx +++ b/src/console/components/console/Input.jsx @@ -24,7 +24,7 @@ class Input extends React.Component { ref={(c) => { this.input = c; }} onBlur={this.props.onBlur} onKeyDown={this.props.onKeyDown} - onInput={this.props.onInput} + onChange={this.props.onChange} value={this.props.value} /> </div> @@ -37,7 +37,7 @@ Input.propTypes = { value: PropTypes.string, onBlur: PropTypes.func, onKeyDown: PropTypes.func, - onInput: PropTypes.func, + onChange: PropTypes.func, }; export default Input; |