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

Add failing test for autocomplete with dynamic type #721

Merged
merged 2 commits into from
Jul 4, 2020

Conversation

lencioni
Copy link
Contributor

This will cause axe to throw an error like:

TypeError: Cannot read property 'replace' of null

I believe that the problem might be related to getLiteralPropValue
returning null instead of undefined for dynamic props.

lencioni and others added 2 commits June 30, 2020 10:42
This will cause axe to throw an error like:

> TypeError: Cannot read property 'replace' of null

I believe that the problem might be related to getLiteralPropValue
returning `null` instead of `undefined` for dynamic props.
@ljharb
Copy link
Member

ljharb commented Jun 30, 2020

I pushed up a fix, but this is really a workaround for what's likely a bug in axe caused by using default values and forgetting that that doesn't handle null. Would you mind filing an issue upstream for it?

@lencioni
Copy link
Contributor Author

Happy to file a bug upstream, but I'm not sure I understand what you mean by this:

caused by using default values and forgetting that that doesn't handle null

@ljharb
Copy link
Member

ljharb commented Jun 30, 2020

hmm, the stack trace points to https://github.com/dequelabs/axe-core/blob/8a4d9b0970ad909100856faf102f14fea4d6c268/lib/commons/text/sanitize.js - but that would fail on undefined too, so my assumption (which may be incorrect) is that they've got code like function foo(x = '') { return x.replace(…); }, which would work for undefined or a string but not for null.

It's really hard to figure out where the error is, though, since they apparently bundle the library :-/

Copy link
Collaborator

@jessebeach jessebeach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lencioni !

Let's get this patch in. @WilcoFiers, the underlying issue here is with aXe; @ljharb has some theories in the comments above.

@jessebeach jessebeach merged commit 31721bd into master Jul 4, 2020
@jessebeach jessebeach deleted the dynamic-input-type-autocomplete branch July 4, 2020 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants