angulardevextremedevextreme-angular

DevExtreme Tab Panel disabled still active


I'm using this DevExtreme template: https://js.devexpress.com/Demos/WidgetsGallery/Demo/TabPanel/Overview/Angular/Light/

So I want to disable some of the tabs. But if I disable the first tab, it still gets set as an active tab. If you switch to another tab you cant switch back. How can I make the tab use the first, not disabled, tab?

Image


Solution

  • Now that I've dived deeper in the DevExtreme docs I found the selectedIndex attribute: https://js.devexpress.com/Documentation/ApiReference/UI_Components/dxTabs/Configuration/#selectedIndex

    Using this conditionally I can solve my problem, but it seems like a pretty dirty workaround. By default it shouldn't set a disabled tab as an active tab.