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

fix(tab): fix unexpected routing #4793

Closed
wants to merge 1 commit into from

Conversation

wesleycho
Copy link
Contributor

  • Change anchor tag to div to prevent unexpected routing being triggered by the browser on generation of anchor tags with nested clickable controls

BREAKING CHANGE: This causes the cursor style to be removed from the tab - implement CSS on the .uib-tab > div selector, or similar, accordingly

This fixes #3266.

- Change anchor tag to `div` to prevent unexpected routing being triggered by the browser on generation of anchor tags with nested clickable controls

BREAKING CHANGE: This causes the cursor style to be removed from the tab - implement CSS on the `.uib-tab > div` selector, or similar, accordingly
@Foxandxss
Copy link
Contributor

Same as accordion.

@wesleycho wesleycho closed this in d59083b Oct 31, 2015
@wesleycho wesleycho deleted the fix/tab-routing branch October 31, 2015 18:36
@chenyuzhcy
Copy link
Contributor

When I am looking at some other tab issues and found the current master branch of bootstrap has lost the style for the tab: http://plnkr.co/edit/E7yLZbAog3JcNgx27nw9?p=preview

Then I found this PR, I think it's because the change from <a> to <div>, I don't know if this is known by the team, just want to let you know.

@icfantv
Copy link
Contributor

icfantv commented Nov 16, 2015

@chenyuzhcy, it's almost certainly because of that. the issue we were having with the <a> is that the browser was handling the click event before Angular even got to it and as a result, the handler in the Angular directive was never getting called. We didn't like this change, but we swallowed our pride and did it. But it breaks the CSS...as you discovered.

And thanks for looking at existing issues first! That's a huge help to us.

@Foxandxss
Copy link
Contributor

This broke more stuff indeed like all the tabs in the general demo (where you can choose between seeing the HTML or the javascript). That was fixed.

I can't repro your issue. Weird.

@Foxandxss
Copy link
Contributor

It is fixed in master, your plunker is missing some extra styles that were added for fixing this.

@chenyuzhcy
Copy link
Contributor

I saw the extra styles, thank you!

@chenyuzhcy
Copy link
Contributor

I copied the styles from the demo.html and found the disabled style is missing:
.nav>li.disabled>div { color: #999; }

@Foxandxss
Copy link
Contributor

If there is something missing, sounds like a good PR deal for me :)

@chenyuzhcy
Copy link
Contributor

ok, I'll create one then

@icfantv
Copy link
Contributor

icfantv commented Nov 16, 2015

When we do the 1.0 official build, we need to thoroughly go through the breaking changes doc and make sure the CSS needed is placed for this item.

@pkyad
Copy link

pkyad commented Dec 29, 2015

I know that this issue was fixed in 1.0 release by I am getting this behavior again. I inspected the generated html and there is anchor tag
1
2

The UI is having dynamic tabs like a web browser and the user can cancel the tab by clicking on the close sign , I am using ng-click in the uib-tab-heading to splice the tabs array

Can anyone point where I am going wrong

thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants