Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aria-invalid={true/false} incorrectly fails check #125

Closed
fracmak opened this issue Dec 12, 2016 · 9 comments
Closed

aria-invalid={true/false} incorrectly fails check #125

fracmak opened this issue Dec 12, 2016 · 9 comments

Comments

@fracmak
Copy link
Contributor

fracmak commented Dec 12, 2016

When specifying aria-invalid="false" or aria-invalid="true", the value gets converted into a boolean by getLiteralPropValue(), which fails the token check because it's looking for a "string".

@ljharb
Copy link
Member

ljharb commented Dec 13, 2016

aria-invalid={true} is not a valid value - that will end up as aria-invalid="aria-invalid", which is not a correct spec value. You must provide the literal string - not boolean - "true" or "false".

If I'm misunderstanding your issue, please provide some code so I can unconfuse myself :-)

@fracmak
Copy link
Contributor Author

fracmak commented Dec 13, 2016

That's what I did and it still failed. aria-invalid="true" as far as I can tell the getLiteralPropValue() function is recognizing the "true" as a Boolean and casting it out of the string. No way I can find around it.

@ljharb
Copy link
Member

ljharb commented Dec 13, 2016

aha, thanks for clarifying.

@beefancohen
Copy link
Contributor

ah good find, thanks! basically, the ARIA properties needs to be able to handle multiple types. In this case, aria-invalid can be either a token or a boolean. would you be interested in trying to fix this bug? i'd be happy to help you along the way!

@fracmak
Copy link
Contributor Author

fracmak commented Dec 14, 2016

Sure, what did you have in mind to fix this? One option I had considered was removing the constraint that all token values had to be string, and instead matching that the token value merely === the value stored in ARIA.json, I'd then update ARIA-INVALID's value's to be [ "grammar", "false", "spelling", "true", false, true ]

@beefancohen
Copy link
Contributor

beefancohen commented Dec 14, 2016

@fracmak great, thanks! always nice getting more people involved.

that seems like a good fix, although i don't think the string values "true" and "false" will ever be hit. [ "grammar", "spelling", true, false ] should be sufficient.

the equality check is here

@fracmak
Copy link
Contributor Author

fracmak commented Dec 14, 2016

Fixed in #126

@beefancohen
Copy link
Contributor

published in v3.0.2! thanks for reporting and your help fixing!

@adillokili

This comment was marked as spam.

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

No branches or pull requests

4 participants