We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

AutoCompleteComponent - Keydown event

Hi Team,

I need the keydown event for AutoCompleteComponent, for auto populating the items which are to be fetched from the databass based on user enter.

And fetched data is stoted in state variable clients.  

Below is the code snippet.

The OnKeyDown is written in below code. However, it is not triggered. 

<AutoCompleteComponent id="search-client" 
dataSource={this.state.clients} ref={(autocomplete=> { this.searchClient = autocomplete; }}
cssClass="e-outline"
floatLabelType="Auto"                                                                                                                        
onKeyDown={this.handleKeyDown}
onChange={this.getSelectedClient}
fields={value'Name' }} popupHeight="250px" placeholder="Search Group/Company" autofill={true} filterType='StartsWith' />

Please kindly suggest me solution.

Many Thanks,
Sinchan

1 Reply

SN Sevvandhi Nagulan Syncfusion Team December 18, 2019 08:54 PM

Hi Sinchan 
 
Greetings from Syncfusion support. 
 
We have checked the reported requirement. We would like to inform you that we have filtering event which will be triggered for the every keydown action. Kindly refer the below code, 
 
[index.js] 
<AutoCompleteComponent id="games" dataSource={this.sportsData} ref={(AutoComplete) => { this.listObj = AutoComplete; }} placeholder="e.g. Australia" fields={this.fields} filtering={this.onFiltering.bind(this)} /> 
 
Please refer the below sample, 
 
 
Please find the UG documentation link below, 
 
 
Regards,  
Sevvandhi N  


Loader.
Live Chat Icon For mobile
Up arrow icon