Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

if aria-value/now/min/max is a decimal value, warning "ARIA state and property values must be valid" #182

Closed
akhoury opened this issue Jul 11, 2015 · 4 comments
Assignees
Labels

Comments

@akhoury
Copy link

akhoury commented Jul 11, 2015

According to the spec, a decimal value is fine. What am I missing?

http://www.w3.org/TR/wai-aria/states_and_properties#aria-valuenow

The value of aria-valuenow is a decimal number. If the range is a set of numeric values, then aria-valuenow is one of those values. For example, if the range is [0, 1], a valid aria-valuenow is 0.5. A value outside the range, such as -2.5 or 1.1, is invalid.

aria-valuenow and aria-valuemax warnings

screen shot 2015-07-11 at 12 40 00 pm

aria-valuemin warning

screen shot 2015-07-11 at 12 33 41 pm

Thank you!

@akhoury
Copy link
Author

akhoury commented Jul 11, 2015

is there a reason why both integer and 'decimal` values are validated the same way?

commit: 2c4f4d0#diff-31cb7b83c1e24f0b5f5b7ebe786bb577R988

src snapshot:

case "integer":
case "decimal":
var validNumber = axs.utils.isValidNumber(value);
if (!validNumber.valid) {
result.valid = false;
result.reason = validNumber.reason;
return result;
}
if (Math.floor(validNumber.value) != validNumber.value) {
result.valid = false;
result.reason = '' + value + ' is not a whole integer';
} else {
result.valid = true;
result.value = validNumber.value;
}
return result;

    case "integer":
    case "decimal":
        var validNumber = axs.utils.isValidNumber(value);
        if (!validNumber.valid) {
            result.valid = false;
            result.reason = validNumber.reason;
            return result;
        }
        if (Math.floor(validNumber.value) != validNumber.value) { // <--- this is testing decimals as well
            result.valid = false;
            result.reason = '' + value + ' is not a whole integer';
        } else {
            result.valid = true;
            result.value = validNumber.value;
        }
        return result;

Looks like an easy fix

@ckundo ckundo added the bug label Jul 24, 2015
@ricksbrown ricksbrown self-assigned this Jul 25, 2015
@ricksbrown
Copy link
Collaborator

Looks like the intention was to fall through from number to decimal not integer to decimal.

@ricksbrown
Copy link
Collaborator

PR #196 will fix this.

ricksbrown added a commit to ricksbrown/accessibility-developer-tools that referenced this issue Jul 25, 2015
@ricksbrown
Copy link
Collaborator

Closed by #196

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

No branches or pull requests

3 participants