You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Input is a small wrapper around React.DOM.input that shims in placeholder functionality for browsers that don't natively support it.
4
+
`Input` is a small wrapper around `React.DOM.input` that shims in `placeholder` functionality for browsers that don't natively support it. Currently only tested with IE9.
You can use `Input` exactly the same way you'd use `React.DOM.input`. All attributes will be passed on, and all event callbacks will be called. However, please note that the placeholder shim only works on [controlled](http://facebook.github.io/react/docs/forms.html#controlled-components) inputs (i.e., you must provide a `value` or `valueLink` prop).
30
+
31
+
When the placeholder text is visible, the `placeholder` CSS class will be added to the `input` element so you can style it, e.g.
32
+
```
33
+
input.placeholder {
34
+
color: gray;
35
+
font-style: italic;
36
+
}
37
+
```
38
+
39
+
### Before
40
+
41
+
Placeholder doesn't show on IE9.
42
+
43
+
```
44
+
<input placeholder="Enter text here..." value={this.state.value} onChange={this.handleChange} />
45
+
```
46
+
47
+
### After
48
+
49
+
Works on IE9!
50
+
51
+
```
52
+
<Input placeholder="Enter text here..." value={this.state.value} onChange={this.handleChange} />
0 commit comments