TabStrip tab scroll to the active tab and how we show that active tab in ui in front scroll to right side

0 Answers 24 Views
TabStrip
Sandip
Top achievements
Rank 1
Sandip asked on 06 May 2024, 06:27 AM | edited on 06 May 2024, 06:55 AM

How can scroll to active tab position dynamically, it becomes the first tab display of selected active tab from backend then it should be display in first position.

 

Example: if i have dates tabStrip then current date tab should be display in first position.

Sandip
Top achievements
Rank 1
commented on 06 May 2024, 11:55 AM | edited

@ViewChild('tabStrip', { static: false }) tabStrip: TabStripComponent;

  scrollToActiveTab() {
    if (this.tabStrip) {
      const selectedTabElement = this.tabStrip.tablist.nativeElement.querySelector('.k-state-active');
      if (selectedTabElement) {
        selectedTabElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
      }
    }
  }

No answers yet. Maybe you can help?

Tags
TabStrip
Asked by
Sandip
Top achievements
Rank 1
Share this question
or