merge develop

This commit is contained in:
Matthew Hodgson
2016-01-18 14:02:19 +00:00
5 changed files with 176 additions and 87 deletions

View File

@@ -49,10 +49,16 @@ module.exports = React.createClass({
this.props.onChange(this.getValue());
},
onCustomChange: function(event) {
onCustomBlur: function(event) {
this.props.onChange(this.getValue());
},
onCustomKeyDown: function(event) {
if (event.key == "Enter") {
this.props.onChange(this.getValue());
}
},
getValue: function() {
var value;
if (this.refs.select) {
@@ -72,7 +78,7 @@ module.exports = React.createClass({
input = <span>{ this.props.value }</span>
}
else {
input = <input ref="custom" type="text" size="3" defaultValue={ this.props.value } onChange={ this.onCustomChange } />
input = <input ref="custom" type="text" size="3" defaultValue={ this.props.value } onBlur={ this.onCustomBlur } onKeyDown={ this.onCustomKeyDown }/>
}
customPicker = <span> of { input }</span>;
}