Tab highlight does not resize when dynamically showing tabs
When dynamically showing / hiding tabs via the [show] attribute, the horizontal line above the buttons does not get updated (2 buttons are shown, but the line behaves as if still 3 buttons are shown (button is ion-tab-button))
Hello, thanks for opening an issue with us! Would you be able to provide a plunker that demonstrates this issue? Thanks for using Ionic!
Hello! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!
Thats the way you handle reported bugs ???
Am 07.07.2016 um 21:24 schrieb Justin Willis <[email protected]mailto:[email protected]>:
Hello! As it seems it has been a while since there was any activity on this issue i will be closing it for now. Feel free to comment if you are still running into this issue. Thanks for using Ionic!
You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/driftyco/ionic/issues/7179#issuecomment-231180927, or mute the threadhttps://github.com/notifications/unsubscribe/AJe6e3FIUOW9evPZ6xehlGfF3xmAmd1yks5qTVJngaJpZM4JD1_I.
Hello, i will happily reopen this issue (: . Would it be possible to get a minimal reproducible example of this issue so that we can debug it? Thanks!
Hello,
same issue here : http://plnkr.co/edit/XMxse2EWSnnaoYGz86TR?p=preview
The tabs are shown according to type variable.
If you click the Thanks button, i call TabPage with params and type is change.
The content is loaded but the tab bar isn't updated.
You would save my mental health :)
Cordova CLI: 6.1.1 Ionic Framework Version: 2.0.0-beta.10 Ionic CLI Version: 2.0.0-beta.30 Ionic App Lib Version: 2.0.0-beta.16 OS: Distributor ID: Ubuntu Description: Ubuntu 15.10 Node Version: v5.12.0
actually i meant something different, look at this plunkr: http://plnkr.co/edit/4et1rgF7eUXrZ6PLuhPO
the blue line of the tabs does not get updated when adding/removing tabs with sho
I researched this a bit. The highlight needs to be readjusted, it currently is only adjusted on a screen resize (https://github.com/driftyco/ionic/blob/master/src/components/tabs/tabs.ts#L324-L326):
this._platform.onResize(() => {
this._highlight.select(this.getSelected());
});
However, if we were to call this from the tab show (with TS errors, https://github.com/driftyco/ionic/blob/master/src/components/tabs/tab.ts#L202):
set show(val: boolean) {
this._isShown = isTrueProperty(val);
this.parent._highlight.select(this.parent.getSelected());
}
It won't update because the tab button width is cached in getDimensions and only gets cleared for a window resize (https://github.com/driftyco/ionic/blob/master/src/components/tabs/tab-highlight.ts#L19):
let d = tab.btn.getDimensions();
console.log(d);
console.log(tab.btn.elementRef.nativeElement.offsetWidth);
Changing L21 to this works:
ele.style.transform = 'translate3d(' + d.left + 'px,0,0) scaleX(' + tab.btn.elementRef.nativeElement.offsetWidth + ')';
Just adding my findings here, need to discuss with @adamdbradley.
Thanks for the issue! This issue is being closed due to inactivity. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Thank you for using Ionic!