react-placeholder-shim

0.0.7 • Public • Published

React-placeholder-shim

Form placeholder for input and textarea in ie8 and 9.

install

Npm:

npm install react-placeholder-shim

Bower:

bower install react-placeholder-shim

Or simply drop the script somewhere on your page (after React of course):

<script src="path/to/react-placeholder-shim.js"></script>

API

The module exposes the placeholderShim object globally if it doesn't detect cjs (npm). Otherwise, it exports the object.

The object contains two components.

<Input />

For inputs type of text and password.

<TextArea />

For textarea.

Usage

/** @jsx React.DOM */
// Assuming the library's dropped in as a script tag.
var Input = placeholderShim.Input;
 
// try this on IE!
var Demo = React.createClass({
  render: function() {
    return (
      <Input type="text"placeholder="hi"onChange={this.handleChange} />
    )
  },
 
  handleChange: function(a, b, c) {
    console.log('it all just works!');
  }
});
 
React.renderComponent(<Demo />, document.body);

License

MIT.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.7
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.7
    2
  • 0.0.6
    1
  • 0.0.5
    1
  • 0.0.4
    0
  • 0.0.3
    0

Package Sidebar

Install

npm i react-placeholder-shim

Weekly Downloads

4

Version

0.0.7

License

MIT

Last publish

Collaborators

  • chenglou