focusIn is not a function

I'm having a problem to set the focus on textbox.
Here I write the html of the component

<ejs-textbox id="Code" #codeInput type="text" name="Code" class="e-input" [(ngModel)]="code" maxlength="50" required></ejs-textbox>

in my component.ts I have :

@ViewChild('codeInput ') codeTextBox : TextBoxComponent;

and later after the page is load I call the:
this.codeTextBox .focusIn();

but I get the error: 
typeError: focusIn is not a function

I have imported the module and the component, and everything works except the focus.
How can I do it?

1 Reply 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team April 16, 2021 04:52 AM UTC

Hello matteo, 


Greetings from Syncfusion support. 


We checked your query of “When calling focusIn after the page load, an error occurs.”. We prepared the sample in mentioned scenario using provided code example. But we were unable to replicate the reported issue at our end. We have attached the test sample below for your reference. Kindly refer the below sample and code. 



Screenshot: 

 

Please check the above sample and if the information given does not help you, please provide additional information such as Syncfusion package version and a simple issue replicating sample to investigate the issue further at our end.   


Regards, 
Sevvandhi N 


Marked as answer
Loader.
Up arrow icon