Tab selectedItem

When i set the   this.tabInstance.selectedItem = 1;
It is firing the clickTabs event, how to avoid it?

I am not seeing any isInteracted property to use
 event.isInteracted




 <ejs-tab #tabsElement id="tabsElement" (selected)="clickTabs($event, true)" class="e-fill">




 clickTabs(argsanyisClickedboolean) {
}

5 Replies 1 reply marked as answer

NR Nevitha Ravi Syncfusion Team June 8, 2021 08:00 AM UTC

Hi Vin, 

Greetings from Syncfusion support. 

We have validated your reported scenario and consider it as feature request to provide argument to know the event is triggered by interaction. You can keep track of the status through the following link. 

The feature will be implemented in any of our upcoming releases. Please use the suggested solution in the below forum until then. 

Regards, 
Nevitha 



VI vin June 8, 2021 04:40 PM UTC

What is the workaround?


NR Nevitha Ravi Syncfusion Team June 9, 2021 06:51 AM UTC

Hi Vin, 

Thanks for your update. 

You can use selecting event to check whether the event is triggered by clicking on the tab header using event argument. Please refer to the following code example and sample. 


    <ejs-tab 
      #tab 
      id="tab_default" 
      heightAdjustMode="Auto" 
      (selected)="clickTabs($event)" 
      (selecting)="select($event)" 
    > 

  public clickTabs(eSelectEventArgs) { 
    if (this.isClicked) { 
      // Your code 
      this.isClicked = false; 
      console.log('tab selected through header'); 
    } 
  } 
  public select(eSelectingEventArgs) { 
    if (!isNullOrUndefined(e.event) && !isNullOrUndefined(e.event.target)) { 
      this.isClicked = true; 
    } 
  } 

In the above sample, the message will print in console only when we select tab using header. It will not print on selecting tab by clicking on the button. 

Please try the solution and let us know if you need any further assistance. 

Regards, 
Nevitha 


Marked as answer

VI vin June 10, 2021 08:35 PM UTC

Thanks


NR Nevitha Ravi Syncfusion Team June 11, 2021 05:07 AM UTC

Hi Vin, 

You are most welcome..! please get back to us if you need any further assistance. 

Regards, 
Nevitha 


Loader.
Up arrow icon