Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ngAria module applies aria-disabled attribute to element when non-explicit false value is present #11998

Closed
redconfetti opened this issue Jun 1, 2015 · 0 comments

Comments

@redconfetti
Copy link

Using Angular 1.4.0 - It appears that ngAria causes the ngDisabled directive to apply aria-disabled="value" even when the ng-disabled expression is not explicitly returning TRUE.

I discovered this when I was using an OR based expression like the following:

<button data-ng-disabled="formNotReadyForProcessing() || formRequestProcessing">Continue</button>

I found that while ngDisabled properly applies or unapplies the disabled="disabled" attribute to the button when this expression did not return an explicit TRUE value, ngAria did not unapply the aria-disabled attribute when the expression did not return an explicit TRUE value (returning undefined).

> var scope = {};
> scope.a = false;
> scope.a || scope.b;
< undefined

Here is a jsFiddle example.

It seems that in my "Undefined Example" you can see that 'undefined' perhaps gets converted to TRUE when assigned to the scope via ngModel.

I'm not completely sure what is causing that, as the "Simple Example" you see it's applying aria-disabled="undefined". I'm not sure if this is what it's receiving from $scope.undefined, or if it's evaluating the 'undefined' in the attribute as a string or as an actual undefined value.

@Narretz Narretz closed this as completed in 3c9096e Jun 1, 2015
netman92 pushed a commit to netman92/angular.js that referenced this issue Aug 8, 2015
…lse"

Previously, when using ngAria with the ng-hide directive,
and the value passed to ng-hide was not boolean,
the aria-hidden attribute was set to this non-boolean value.

Closes angular#11865
Closes angular#11998
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant