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

Unknown DOM property autocomplete when W3C spec says HTMLInputElement.autocomplete, autofocus #10139

Closed
binki opened this issue Jul 11, 2017 · 1 comment

Comments

@binki
Copy link

binki commented Jul 11, 2017

Do you want to request a feature or report a bug?

bug

What is the current behavior?

I get:

Warning: Unknown DOM property autocomplete. Did you mean autoComplete?

When I use autoComplete works fine.

This is misleading because the name of the DOM property is autocomplete, not autoComplete. React implies that the DOM property is named differently than it really is.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/84v837e9/).

https://jsfiddle.net/binki/84v837e9/133/

What is the expected behavior?

Accepts autocomplete, rejects autoComplete.

OR

The error message should not claim that autoComplete is the name of a DOM property because it isn’t. I don’t see any mention of a DOM property called autoComplete in the IDL documentation for HTMLInputElement, but I do see mention of autocomplete. It should claim that autoComplete is a “React property name mapped onto a differently-named DOM property” or use some other wording (I’m not good at coming up with wordings).

> typeof document.createElement('input').autocomplete
"string"
> typeof document.createElement('input').autoComplete
"undefined"

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

react-15.6.1

Same issue exists for at least HTMLInputElement.autofocus.

@gaearon
Copy link
Collaborator

gaearon commented Jul 11, 2017

Thanks for the report!

React generally uses camelCase convention for JSX property names. This is a duplicate of #2882.

We might revisit this some time in the future, but this is intentional and not a bug.

@gaearon gaearon closed this as completed Jul 11, 2017
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

No branches or pull requests

2 participants