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

Input elements always rendered with name attribute #7198

Closed
okonet opened this issue Jul 6, 2016 · 6 comments
Closed

Input elements always rendered with name attribute #7198

okonet opened this issue Jul 6, 2016 · 6 comments

Comments

@okonet
Copy link
Contributor

okonet commented Jul 6, 2016

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

This is a bug (I think)

What is the current behavior?

When rendering <input type="..." /> (without name attribute), it will render <input type="..." name /> to the DOM.

2016-07-06 at 09 49

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/reactjs/69z2wepo/).

Here is the example with the regression using React 15.2.0: https://esnextb.in/?gist=c4923716061ca73e37f7ed476920aa9c

2016-07-06 at 09 49

What is the expected behavior?

No name attribute rendered if it is not provided.

Here is the expected behavior with React 15.1.0: https://esnextb.in/?gist=aee86dfa6eec38aa2bc24b4c25425905

2016-07-06 at 09 54

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

Regression: v15.2.0

Good: v15.1.0

@syranide
Copy link
Contributor

syranide commented Jul 6, 2016

Here is the example with the regression using React 15.2.0: https://esnextb.in/?gist=c4923716061ca73e37f7ed476920aa9c

Is using React 15.1.0 so it's not showing there, but yes I see the problem as well.

cc @jimfb #6406 https://github.com/facebook/react/pull/6406/files#diff-1b0e3b280991cd0b7cde194b30353b3eR253

@syranide
Copy link
Contributor

syranide commented Jul 6, 2016

So there are two problems with #6406.

https://github.com/facebook/react/pull/6406/files#diff-1b0e3b280991cd0b7cde194b30353b3eR250 + https://github.com/facebook/react/pull/6406/files#diff-1b0e3b280991cd0b7cde194b30353b3eR253 should only be set when name !== ''.

https://github.com/facebook/react/pull/6406/files#diff-1b0e3b280991cd0b7cde194b30353b3eR250 should set it to '' and not undefined as that actually translates to 'undefined', which makes it still named.

@okonet
Copy link
Contributor Author

okonet commented Jul 6, 2016

@syranide I've updated the first gist with proper version. Sorry messed it up a bit.

@alexzherdev
Copy link
Contributor

If there are no objections, I'd like to try and fix this one.

On Wednesday, 6 July 2016, Andrey Okonetchnikov notifications@github.com
wrote:

@syranide https://github.com/syranide I've updated the first gist with
proper version. Sorry messed it up a bit.


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

@okonet
Copy link
Contributor Author

okonet commented Jul 6, 2016

I'm already on it.

@alexzherdev
Copy link
Contributor

k, no problem

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

3 participants