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

Bug: uib-uncheckable not working on radio button directive #5412

Closed
JAnderson1122 opened this issue Feb 4, 2016 · 3 comments
Closed

Bug: uib-uncheckable not working on radio button directive #5412

JAnderson1122 opened this issue Feb 4, 2016 · 3 comments

Comments

@JAnderson1122
Copy link

I found this using your demo page: https://angular-ui.github.io/bootstrap/#/buttons

The right button in the right group is never rendered uncheckable.

Examining/tracing through the code, I think I can explain why it is not working and suggest a solution.
Lines 45-49 of buttons.js are intended to remove the uncheckable attribute from the element if uib-uncheckable evaluates to false. However, removing an attribute using attrs.$set(uncheckable, null) does not seem to work. It looks like the angular function$set()leaves the attribute key/value ofuncheckable="uncheckable"on theattrsobject. In line 37, a check is made to see ifuncheckableis present usingangular.isDefined(attrs.uncheckable). This seems to always returns true becauseuncheckable="uncheckable"evaluates touncheckable=null`.

You might need to remove the attribute from the element directly using removeAttribute() instead of using the angular function $set().

Let me know how I can help.

@JAnderson1122 JAnderson1122 changed the title uib-uncheckable not working on radio button directive Bug: uib-uncheckable not working on radio button directive Feb 4, 2016
@wesleycho
Copy link
Contributor

This does look like a bug - if you want to file a PR fixing this, it'd be welcome. Just let me know if you want to work on a fix - if not, I can take a deeper dive into it.

@JAnderson1122
Copy link
Author

I can work on a fix over the weekend. I will update by Monday AM.

Sent from my iPhone

On Feb 4, 2016, at 1:45 PM, Wesley Cho notifications@github.com wrote:

This does look like a bug - if you want to file a PR fixing this, it'd be welcome. Just let me know if you want to work on a fix - if not, I can take a deeper dive into it.


Reply to this email directly or view it on GitHub.

@c-vetter
Copy link
Contributor

c-vetter commented Feb 9, 2016

Ran into this today, see my pull request for a fix ;)

@wesleycho wesleycho added this to the 1.2.0 milestone Feb 9, 2016
@wesleycho wesleycho removed the PRs plz! label Feb 9, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants