项目作者: fudanfuhua

项目描述 :
react working in contenteditable element for iphone,chrome,safari(webkit kernel browser) to fix focus bug
高级语言: JavaScript
项目地址: git://github.com/fudanfuhua/react-focus-element.git
创建时间: 2017-09-16T15:04:03Z
项目社区:https://github.com/fudanfuhua/react-focus-element

开源协议:

下载


react-focus-element

styled with prettier
Travis CI build status
Dependency Status
View on npm
View on npm

A React component working use “contenteditable element” to fix focus bug on iphone, mac, and chrome(webkit kernel browser).

Install

  1. npm install --save react-focus-element

Note: This component can work on most platform and most browser

Usage

  1. var React = require('react');
  2. var FocusElement = require('react-focus-element');
  3. React.render(<FocusElement onInput={(e) => {}} />, document.body);

Examples

  1. var React = require('react');
  2. var FocusElement = require('react-focus-element');
  3. var MyComponent = React.createClass({
  4. render: function () {
  5. return (
  6. <FocusElement
  7. id="publish-message__title"
  8. className={className}
  9. onInput={(e) => {this.handleArticleContentChange('title', e.target)}}
  10. />
  11. );
  12. }
  13. });

Contributing

Pull requests welcome!

Run the test suite with npm test and format your code with npm run format. Make sure tests are passing and that you write tests for new features and document changes to the API with updates to the JSDocs.

Before you submit your pull request, run npm run dist to build the project and commit the changes.

License

MIT © fudanfuhua