-
-
Notifications
You must be signed in to change notification settings - Fork 629
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
isInteractiveElement() test for higher level JSX components produces false negatives when components are similarly named to DOM elements #46
Comments
yeah, i think the goal is to use String.normalize but I'm unsure of the support on node and how (if?) it transpiles through babel. Let me make a commit using In the meantime, I'd give a more descriptive name to your wrapper component or just use |
This will hit Airbnb too, as we have a |
Yeah, after re-thinking it I agree. About to put in a fix by lower casing all of the dom elements in the JSON file because we can safely assume that low-level DOM elements are all lower-cased. |
…es between capitalization subtleties between components and DOM elements Fixes #46 I think we can safely assume that pure DOM elements will be lower-cased, especially in the React world.
The test to skip testing higher level JSX components in isInteractiveElement seems to be too broad as it uses
.toUpperCase()
on thetagName
before comparing with the map of DOM elements. This produces false negatives when a custom component is named similarly to a DOM element, but with capitalizations (eg.Button
vs.button
).To my knowledge, removing the
.toUpperCase()
should fix this, but I'm not sure if there are non-React use cases of JSX where, for example,Button
might mean the same asbutton
, or if there were any other factors that required relaxing the case-sensitivity.The text was updated successfully, but these errors were encountered: