的jsfiddle:https://jsfiddle.net/leiming/5e6rtgwd/的onfocus氣泡在陣營
class Sample extends React.Component {
onInputFocus(event) {
console.log('react input focus')
}
onSpanFocus(event) {
console.log('react span focus')
// event.stopPropagation()
}
render() {
return (<span onFocus = {this.onSpanFocus}>
react input: <input type="text"
onFocus = {this.onInputFocus} />
</span>)
}
}
ReactDOM.render(< Sample/> ,
document.getElementById('container')
);
<div id="container">
<!-- This element's contents will be replaced with your component. -->
</div>
<div>
<span onfocus="(function(){console.log('normal span')})()">
normal input:<input type="text" onfocus="(function(){console.log('normal input focus')})()">
</span>
</div>
的jsfiddle:https://jsfiddle.net/leiming/5e6rtgwd/
使用反應,onFocus
在<input/>
將泡沫這是不平常一樣HTML5。
任何人都可以給我推薦文檔爲什麼集中泡泡與React?
他們正在研究它:https://github.com/facebook/react/issues/6410 – velop