vaguely skin MemberInfo correctly

This commit is contained in:
Matthew Hodgson 2016-01-18 01:18:02 +00:00
parent 430c90f4a4
commit 8e1ab8e6b4
4 changed files with 83 additions and 31 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>;
}