dillon1000/react

Commit

Correctly render placeholder for textarea in IE11 (#8020)

* Check if textContent should be set for textarea

shouldSetNodeTextContent returns whether a node.textContent should be
updated. Currently it only covers one case, which is to avoid setting
the textContent if the text is empty and a placeholder exists.

* Only set node.value if it's equal to initialValue

In IE11 textContent is populated when the placeholder attribute is set.
Without this check, we end up setting node.value equal to the
placeholder text, causing the textarea to actually render with the text
inside.

This check makes sure that textContent is equal to our expected
initialValue, which should be the case when using defaultValue.

* Remove placeholder/textarea check, use contentToUse instead
Browse files
Changed paths2 files
First-parent comparison
M src/renderers/dom/stack/client/ReactDOMComponent.js ModifiedM src/renderers/dom/stack/client/wrappers/ReactDOMTextarea.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…