JKnorr91 / ion-slide-box-tabs

An Add-On directive for the ion-slide-box, that adds tabs to the slide box, known from the Android Material Design specification
MIT License
248 stars 110 forks source link

Current tab is not selected on Windows Phone Universal (8.1+) #10

Open GhislainL opened 9 years ago

GhislainL commented 9 years ago

The current tab is not selected properly on a Windows Phone Universal (8.1+). After a bit of debugging I found out that ionicSlideBoxDelegate.currentIndex() return the previous tab index on this OS. To fix this, add a short timer before the function onSlideChange when the platform is Windows Phone : scope.onSlideChange = function (slideIndex) { if (ionic.Platform.isWindowsPhone()) { $timeout(function () { slideToCurrentPosition(); }, 50); } else { slideToCurrentPosition(); } };

Regards,

Ghislain