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

Issues with autoCorrect attribute set as property #5436

Closed
ghost opened this issue Nov 10, 2015 · 3 comments
Closed

Issues with autoCorrect attribute set as property #5436

ghost opened this issue Nov 10, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 10, 2015

Hey. As far as I can see, the autoCorrect attribute are set as an HTML property.
https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js#L194

This can give issues with Input elements. Check this :

  • Chrome 46.0.2464.0: autocorrect in document.createElement('input') === false
  • Safari 8.0.7: autocorrect in document.createElement('input') === false
  • Mobile Safari (iOS 8.4 simulator): autocorrect in document.createElement('input') === true

There are identical issues with some other browsers as well.

This is not tested on iOS 9.x

@zpao
Copy link
Member

zpao commented Dec 2, 2015

autocorrect is only supported in mobile Safari AFAIK, which explains your results. FYI your test passes in iOS 9(.1 in a simulator, didn't test on real device but I trust the simulator).

On desktop, the attribute is ignored and actually, it looks like spellcheck does pretty much the same thing in Safari.

Now that said, the property is a boolean and the attribute supports 'on' and 'off' as values (corresponding to true/false for the property). With our markup generation code, we don't currently support booleans properties corresponding to specific values in the attributes so the best course of action here is probably to do what you suggest and just make this MUST_USE_ATTRIBUTE

@JemarJones
Copy link

JemarJones commented Feb 14, 2017

@zpao I've searched far and wide for an official answer on this and it looks like i might be close, can you confirm for me: Should i use 'off' or false/'false' for autoCorrect and autoCapitalize?

@syranide
Copy link
Contributor

@JemarJones If it is listed as a boolean property in HTMLDOMPropertyConfig then it should be either boolean true or false, otherwise it's passed through as a string as-is and whatever value the HTML attribute expects should be the one to pass (different for different attributes).

https://github.com/facebook/react/blob/master/src/renderers/dom/shared/HTMLDOMPropertyConfig.js

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

3 participants