Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

activeTab.position() undefined when initializing empty tabs #511

Open
vanilla-thunder opened this issue Apr 4, 2017 · 0 comments
Open

Comments

@vanilla-thunder
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant