Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

ReactDOMInput should not set a value for submit buttons unnecessarily fails in IE #518

Closed
subtleGradient opened this Issue · 7 comments

5 participants

@subtleGradient
ReactDOMInput should not set a value for submit buttons unnecessarily.

Expected true to be false.
@zpao
Owner

Might not be the easiest first bug, but would be interesting to find out why this is failing. Requires some browser knowledge.

@andrewdavey

I did a bit of digging... In IE, the presence of type="submit" seems to add an implicit value attribute.

Running the following:

var i = document.createElement("input");
console.log("before: " + i.hasAttribute("value"));
i.type = "submit";
console.log("after: " + i.hasAttribute("value"));

Chrome logs:

before: false
after: false

IE logs

before: false
after: true

So this could be causing the problem.

@zpao
Owner

Interesting… What is the value in this case? Which version of IE? MSDN says the text will default to "Submit Query", so I'm guessing it's that. Maybe we just need to skip this test sometimes?

@andrewdavey

Quick testing in IE 11 results in the value being "Submit Query".

@subtleGradient

Sounds like an encapsulation leak. Perhaps the input component should provide some sort of value getter instead of encouraging us to reach in and noodle with its DOM node. cc @sebmarkbage

@sebmarkbage
Collaborator

Seems like a problem with the test rather than the implementation.

@spicyj
Owner

Fixed by #1658.

@spicyj spicyj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.