lumapps / lumX

The first responsive front-end framework based on Angular & Google Material Design specifications

Home Page:https://ui.lumapps.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

activeTab.position() undefined when initializing empty tabs

vanilla-thunder opened this issue · comments

commented

Hi,
i use lx-tab for danymic content categories, here is a simplified version of my code:
js:

$scope.tabs = [];
$scope.tabs = loadTabsFromUrl(); // dynamic json data for tabs, like: [ 'Tab 1', 'Tab 2', 'Tab 3' ]

html:

<lx-tabs>
   <lx-tab ng-repeat="_tab in tabs" lx.label="{{ _tab }}">
      ... some more dynamic content ... 
   </lx-tas>
</lx-tabs>

This must have worked with some older version of lumx, i guess 1.3, but after recent update to 1.4 and then 1.5 i'm receiving an error "cannot read property 'left' of undefined" in lumx.js (4994), which is:
var indicatorLeft = activeTab.position().left;

Obviously there is no activeTab when there are no tabs at all, so activeTab.position() is undefined.
I have fixed this by adding ng-if="tabs.length > 0" to <lx-tabs>

kind regards,
Marat