Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
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

Description

@redconfetti

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions