輸入文本框在輸入時失去焦點。這是一段代碼。不能明白問題在哪裏。以下內容不是完整的代碼,但它有點像這樣。能否請你告訴我在哪裏,我在做錯誤輸入文本框丟失焦點輸入反應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>
)
}
});