ngOfficeUIFabric / ng-officeuifabric

Office UI Fabric (https://github.com/OfficeDev/office-ui-fabric) implementation for Angular
http://ngOfficeUiFabric.com
MIT License
321 stars 67 forks source link

<uif-dropdown> Element disabled for any value of disabled, true or false #259

Closed oviava closed 8 years ago

oviava commented 8 years ago
<uif-dropdown ng-model="selectedElement" selected-title="Select Element" disabled={{false}}>

Expected behaviour - element should be enabled

Actual behaviour - element is disabled

I'm trying to dynamically control the status of the element but if the attribute disabled exists on the element it will always be disabled, regardless of value.

andrewconnell commented 8 years ago

Hmmm... @rolandoldengarm is this related to the other fixes you recently implemented for other directives? Is this something that affects all our directives?

ghost commented 8 years ago

No it's not related to the recent changes. Disabled is not a true/false attribute by default in HTML. Ng-disabled should do the trick, it adds /removes the disabled attribute based on the expression. For some reason that does not work.

https://jsfiddle.net/pvujzamh/

oviava commented 8 years ago

actually https://www.w3.org/TR/html5/forms.html#enabling-and-disabling-form-controls:-the-disabled-attribute

The disabled content attribute is a boolean attribute.

edit: ignore above, incorrect, left comment for posterity

and no, ng-disabled doesn't work either

oviava commented 8 years ago

actually .. I'll eat my own words :). still, would be nice to able to control disabled or not dynamically, there is really no point on setting disabled on an element without being able to dynamically change it

ghost commented 8 years ago

It's a valid bug. Ready for dev.