I try to compare entered key code on change event of input but when I try it, I only see Proxy object instead of event handler object. I couldn't find any solution. In another component I achieved it but in this component I can't.
My handler function is :
handleChange(event){
this.setState({
searchValue : this.searchInput.value
});
if(this.searchInput.value.length>2&&!this.state.recommendation&&this.focused){
this.setState({
recommendation:true
});
} else if(this.searchInput.value.length<3&&this.state.recommendation&&this.focused) {
this.setState({
recommendation:false
});
return;
}
console.log(event) //event is returned as Proxy object
if(event.keyCode === 13){
this.context.router.history.push(`/yardim/arama/${this.searchInput.value}`);
return;
}
if(this.searchInput.value.length>2){
this.bouncer.handle();
}
}
and render function is :
render(){
return(
<div id="faq-search-box">
{this.state.recommendation}
<i className="icon hb-icon-search_icon"></i>
<input id="faq-search-input" type="text" placeholder="Yardım konusu ara..." value={this.state.searchValue} ref={input=>{this.searchInput=input;}} onChange={this.handleChange.bind(this)} onFocus={this.onFocus} onBlur={this.onBlur} />
<div className="clearfix"></div>
{ this.state.recommendation &&
<div id="faq-recommendation-box">
{this.props.FAQRecomendations&&
<ul>
{this.props.FAQRecomendations.map((faq)=>
<li key={faq.id}><a onMouseDown={(e)=>{this.onMouseDown(`/yardim/${faq.slug}#${faq.id}`,e)}} title={faq.name}>{faq.name}</a></li>
)}
</ul>
}
</div>
}
</div>
)
}
What is the problem? How can I Access the event handler?