[URGENT] SFTextbox FocusIn not working on load version 18.3.0.35

Hi Syncfusion,

In my company's project, there is one page that required the SFTextBox to be auto focused on load. 
But FocusIn event not working need help on this case. 
The codes below is the example of my code. TxtCard is SFTextBox ref in code.




3 Replies 1 reply marked as answer

PM Ponmani Murugaiyan Syncfusion Team October 5, 2020 12:49 PM UTC

Hi Khoo, 

Thanks for contacting Syncfusion support. 

We have validated your reported issue. The cause for the issue is “In onInitialized method you won’t get the instance of the TextBox component”, so the control not get focused on page load. The same can be achieved using Created event of the component, in which you can get the instance and the component gets focused on loading the page. 

@using Syncfusion.Blazor.Inputs 
 
<SfTextBox @ref="txtCard" Placeholder='First Name' FloatLabelType='@FloatLabelType.Auto' Created="onCreated"></SfTextBox> 
 
@code {       
    SfTextBox txtCard; 
    public void onCreated(Object args) 
    { 
       txtCard.FocusIn(); 
    } 
} 

 

 
Kindly check with the above suggestion meets your requirement. Please get back us if you need further assistance. 

Regards, 
Ponmani M 


Marked as answer

KH Khoo October 6, 2020 01:55 AM UTC

Hi Ponmani M, 

Thanks for your help on this case. 

Regards, 
Khoo


PM Ponmani Murugaiyan Syncfusion Team October 6, 2020 04:22 AM UTC

Hi Khoo, 

Thanks for the update. Please get back us if you need further assistance. 

Regards, 
Ponmani M  


Loader.
Up arrow icon