I have the following code
<ElementsBasket
name="nextActionDate"
data={this.props.newLead.get("actions").get("nextActionDate")}
>
<div className="form-group">
<span className="glyphicon glyphicon-calendar">Calendar </span>
<span className="glyphicon glyphicon-triangle-bottom"></span>
<input
type="text"
className="form-control"
onFocus={(this.type = "date")}
onBlur={(this.type = "text")}
placeholder="Enter your date here."
value={this.props.newLead.get("actions").get("nextActionDate")}
onChange={onFieldChanged.bind(this, "actions.nextActionDate")}
/>
</div>
</ElementsBasket>;
In the input tag, I am trying to have a placeholder text appear in the input field by default, and when clicked I would like the type to be changed as date. And the problem seems to be when clicked inspect element on the Chrome. It would not show onFocus
and onBlur
.
P/S: Even the onClick
seems to have the same problem
question from:
https://stackoverflow.com/questions/31247214/onfocus-and-onblur-does-not-render-in-react 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…