Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

active two-way data binding is broken in 1.2.0 and 1.2.1 #5551

Closed
WillBDaniels opened this issue Feb 28, 2016 · 13 comments
Closed

active two-way data binding is broken in 1.2.0 and 1.2.1 #5551

WillBDaniels opened this issue Feb 28, 2016 · 13 comments

Comments

@WillBDaniels
Copy link

Bug description:

The 2-way data binding for the 'active' attribute in the tab component seems to be completely broken with the latest two versions. I'd give a plnkr, but plnkr is giving me a helluva time loading the latest js, in fact, so is jsfiddle. here's a working example: https://jsfiddle.net/willbdaniels/2mq3106a/14/ it just has the js I needed (1.2.0) embedded. you can change the raw js around to see the problem not being present in the version just before that

Version of Angular, UIBS, and Bootstrap

Angular: 1.4.8

Bootstrap: 1.2.1

Edit to add in nice plunker

http://plnkr.co/edit/GkyGI4V92I4DXp3CWYwp

@icfantv
Copy link
Contributor

icfantv commented Feb 28, 2016

@WillBDaniels, you can use the 'Edit in Plunker' link from our demo page to create a basic working plunker you can use to reproduce your issue. Your instructions are a little vague so we're going to need a plunker that shows the issue. Thanks.

@WillBDaniels
Copy link
Author

@icfantv alright, I think i got the plunk working, you can see the behaviour here: http://plnkr.co/edit/GkyGI4V92I4DXp3CWYwp

Namely, you'll notice that the $scope.activeTab is being completely unaffected by the 'active' property on the uib-tab. Then, if you change the ui-bootstrap version to '1.1.2' in the index.html instead of 1.2.1, the behaviour goes back to normal, and all $scope variables are respected again.

@icfantv
Copy link
Contributor

icfantv commented Feb 28, 2016

Thank you. I was able to confirm this as an issue in our application at work as well. Marking as a bug.

@wesleycho
Copy link
Contributor

This is not a bug - the active attribute was changed, as noted in the changelog. The new usage is shown in the example.

Here is a working Plunker

@icfantv
Copy link
Contributor

icfantv commented Feb 29, 2016

@WillBDaniels, with apologies for the team, this should have been marked as a breaking change so it showed up in the change log. It wasn't so it didn't. I will update when I get to work.

@WillBDaniels
Copy link
Author

It's worth noting, that in the official documentation link to docs the 'select tab' buttons are still broken due to this change. But I appreciate you guys responding so quickly! It was pretty unexpected having this break on a regular npm update

@icfantv
Copy link
Contributor

icfantv commented Feb 29, 2016

Aw man. Yea. Good catch.

@icfantv
Copy link
Contributor

icfantv commented Feb 29, 2016

We still need the docs update portion of this even though the CHANGELOG has been fixed.

@RopoMen
Copy link
Contributor

RopoMen commented Mar 1, 2016

Hi,
I was waiting this 1.2.x release so much because of template-url attribute for tabs. But I had to disappoint a little because of this active handling.

I needed to use different tab template on one page and default template on another. I was first testing it with global override using $provide in .config() phase, but it changed the new template for all pages. (ofc.)

What I need, is that I can toggle tab open/close.

Here is Jsfiddle where I have uib 1.1.2 in use
as you can see I was able to open/close tabs. (toggle)

Here is Jsfiddle with latest uib 1.2.x and I haven't been able to get that toggle feature to work. How this can be done? (if it even can be done)

I could do this if 'select' would be called on each click. Or could this toggle be done to the main tab ctrl + template?

I'm in the situation where I need to revert to 1.1.x series and make some hax logic in to .config() section where I detect that which page I am and override tab template on the right page.
Or
I need to create my own copy-paste tab solution :|

@icfantv
Copy link
Contributor

icfantv commented Mar 1, 2016

@RopoMen, please do not hijack issue threads. Additionally, per our project documentation, the issues forum is not for support requests. Please use a wider-audience venue like StackOverflow. Thanks.

@bmvantunes
Copy link

Hi,

You have an error in your page. Look at: https://angular-ui.github.io/bootstrap/#/tabs
When we click, for example, "select third tab" nothing happens.

Thanks a lot,
Bruno

@icfantv
Copy link
Contributor

icfantv commented Mar 2, 2016

@bmvantunes, please be respectful of our time by 1) reading the issue on which you are commenting and 2) performing a search of existing issues before entering anything. What you've entered has already been noted above. Additionally, it is a duplicate of #5558 and #5560.

@bmvantunes
Copy link

Hi @icfantv, I did not want to disrespect you in any way. I really love your work!

icfantv added a commit to icfantv/bootstrap that referenced this issue Mar 2, 2016
* update tab documentation to clarify proper use and intended behavior of the
  `active` attribute on both the `tabset` and `tab` directives.
* fix the tab select buttons in the tab demo.

Fixes angular-ui#5551
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants