How to set focus to ejDropDownList

Hi,

When I move between elements using Tab key, I can see ejDropDownList element is focused and I can easily select option using arrow key.

I have a case that checks if value is not yet selected, it will show error message and set focus to the element. How to manually set focus to it? I used showPopup() method but it does not meet my expectation. I expect it to behave like I am using Tab key.

Thanks.

3 Replies

KV Karthikeyan Viswanathan Syncfusion Team August 27, 2018 09:00 AM UTC

Hi Nga,   
  
Thanks for contacting Syncfusion Support.   
  
Based on your scenario, you can focus the DropDownList by using wrapper element.    
  
Please refer to the below code example:   
  
<Code>   
  
var inst = $('#skillsets').ejDropDownList("instance");   
        inst.wrapper.focus();   
  
</code>   
  
  
Regards,   
Karthikeyan V.   




NG Nga August 28, 2018 01:24 AM UTC

Thanks. It works.


KV Karthikeyan Viswanathan Syncfusion Team August 28, 2018 05:19 AM UTC

Hi Nga,  
 
Thanks for the update. 
 
We are glad to hear that your issue has been resolved. 
 
Regards, 
Karthikeyan V. 


Loader.
Up arrow icon