Question about Tab Blazor Wasm

Hi
I have one question, 
Estoy usando el componente Tab en Blazor wasm with two tab items, when page loads only first tab is visible, with one button i show the second tab and select this, but select the second tab not works. Only if bot tabs was visible on load select works!

Version 19.1.055


3 Replies 1 reply marked as answer

SK Satheesh Kumar Balasubramanian Syncfusion Team April 12, 2021 10:37 AM UTC

Hi Jose, 
  
Greetings from Syncfusion Support..! 
  
We have validated your reported query "Question about Tab Blazor Wasm" at our end and prepared sample based as per your shared scenario. We suspect that you have used Select method to change the tabs which might cause the reported problem.  So we suggest you to use two-way binding of SelectedItem property instead of Select method to overcome the reported issue. For the same we have prepared a sample for your reference which can be downloaded from the following link. 

  
Code Snippet: 
@using Syncfusion.Blazor.Navigations 
@using Syncfusion.Blazor.Buttons 
  
<SfTab @ref="Tab" @bind-SelectedItem="SelectedTab"> 
    <TabItems> 
        <TabItem> 
            <HeaderTemplate> 
                <div>Button Component</div> 
            </HeaderTemplate> 
            <ContentTemplate> 
                <SfButton @onclick="OnItemClick" Content="Show second item"></SfButton> 
            </ContentTemplate> 
        </TabItem> 
        <TabItem Visible="@ShowItem"> 
            <HeaderTemplate> 
                <div>Facebook</div> 
            </HeaderTemplate> 
            <ContentTemplate> 
                <div>Facebook is an online social networking service headquartered in Menlo Park, California. Its website waslaunched on February 4, 2004, by Mark Zuckerberg with his Harvard College roommates and fellow students EduardoSaverin, Andrew McCollum, Dustin Moskovitz and Chris Hughes.</div> 
            </ContentTemplate> 
        </TabItem> 
    </TabItems> 
</SfTab> 
  
@code { 
    SfTab Tab; 
    private int SelectedTab = 0; 
    public bool ShowItem = false; 
    void OnItemClick() 
    { 
        ShowItem = true; 
        //await Tab.Select(1); 
        SelectedTab = 1; 
    } 
} 
  
  
  
Kindly try the above solution and get back to us if you need further assistance. 
  
Regards, 
Satheesh Kumar B 


Marked as answer

JL jose luis barajas April 12, 2021 04:33 PM UTC

Hi Satheesh 

Thanks for your support!
Its working fine now!

Have nice day!


NR Nevitha Ravi Syncfusion Team April 13, 2021 06:23 AM UTC

Hi Jose, 

You are most welcome..! we are glad that our provided solution helped you. Please get back to us if you need any further assistance. 

Regards, 
Nevitha  


Loader.
Up arrow icon