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

autoFocus prop has wrong capitalization vs React #165

Closed
wmertens opened this issue Jul 21, 2016 · 2 comments
Closed

autoFocus prop has wrong capitalization vs React #165

wmertens opened this issue Jul 21, 2016 · 2 comments

Comments

@wmertens
Copy link
Contributor

All through the code, autofocus is used, however React writes it as autoFocus, and that causes mistakes. Please use the more common autoFocus spelling.

See also #95 which partially fixes it (slightly breaking the API in the process).

wmertens added a commit to wmertens/elemental that referenced this issue Jul 21, 2016
This gets rid of the warning in React 15.2+

Note that `autofocus` needs stripping too, but if you implement elementalui#165 this is not necessary.
@wmertens
Copy link
Contributor Author

In fact, since the components just pass other props, autoFocus already works on everything. So you can just deprecate autofocus and turn it into autoFocus props.

wmertens added a commit to Yaska/keystone that referenced this issue Jul 25, 2016
React does the right thing with it and Elemental-UI already supports it: elementalui/elemental#165

This removes stateful code. It also works in the Modal because the Modal will not render its contents until it opens: https://github.com/elementalui/elemental/blob/620efc246d7f5fd123a2af3fa7f07bf4e745a0fb/src/components/Modal.js#L127-L128
@wmertens
Copy link
Contributor Author

Note that the this.focus() calls on componentDidMount are now not
necessary, React does that if you pass the autoFocus prop to the component.

On Tue, Jul 26, 2016, 5:08 AM Jed Watson [email protected] wrote:

Closed #165 #165 via
1712ccd
1712ccd
.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#165 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AADWlu1nP5D9MpTAmsjRSH6XIOk2eac7ks5qZXo2gaJpZM4JRtEp
.

jonathanwmaddison pushed a commit to jonathanwmaddison/elemental that referenced this issue Aug 15, 2017
This gets rid of the warning in React 15.2+

Note that `autofocus` needs stripping too, but if you implement elementalui#165 this is not necessary.

git-svn-id: https://github.com/elementalui/elemental.git@738 773dd515-ab26-cda1-e266-ce57b7db7bff
jonathanwmaddison pushed a commit to jonathanwmaddison/elemental that referenced this issue Aug 15, 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

1 participant