输入文本框在输入时失去焦点。这是一段代码。不能明白问题在哪里。以下内容不是完整的代码,但它有点像这样。能否请你告诉我在哪里,我在做错误输入文本框丢失焦点输入反应js
var PaymentDetailCard = React.createClass({
getInitialState: function() {
return {
card: {
number: "",
userName: "",
dateWon: "",
prepayDue:"",
prepayApplied: "",
},
}
},componentDidMount: function() {
this.setState({ card: this.props.card });
},
getPrepayAppliedInput:function(){
var input;
input =
<input
type="text"
id="prepayAppliedCard"
value={this.state.card.prepayApplied}
onChange={this.change} maxLength ="10"
/>;
return(
<div><span>$</span>{input}</div>
)
},
change:function(event){
this.setState({prepayApplied: event.target.value});
PaymentActions.sendRowNum(this.props.rownum);
{this.props.onPrepayAppliedChange(event)};
},
getUniqueID: function() {
return Math.random().toString(36).substring(7);
},
render: function() {
return (<div>{this.getPrepayAppliedInput()} </div>
)
}
});