├── tests ├── requestAnimationFrame.js ├── textarea.test.js ├── utils.js ├── input.test.js ├── checkbox.test.js └── select.test.js ├── .babelrc ├── rollup.config.js ├── LICENSE ├── .gitignore ├── package.json ├── dist ├── react-input-handler.esm.js ├── react-input-handler.js ├── react-input-handler.umd.js ├── react-input-handler.umd.js.map ├── react-input-handler.js.map └── react-input-handler.esm.js.map ├── src └── ReactInputHandler.js ├── CODE_OF_CONDUCT.md ├── README.md └── yarn.lock /tests/requestAnimationFrame.js: -------------------------------------------------------------------------------- 1 | global.requestAnimationFrame = (callback) => { 2 | setTimeout(callback, 0) 3 | } 4 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "test": { 4 | "presets": ["es2015", "react"], 5 | "plugins": ["syntax-object-rest-spread", "transform-object-rest-spread"] 6 | }, 7 | "production": { 8 | "presets": ["es2015-rollup", "react"], 9 | "plugins": ["syntax-object-rest-spread", "transform-object-rest-spread"] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/textarea.test.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | import './requestAnimationFrame' 4 | 5 | import React from 'react' 6 | import Enzyme from 'enzyme' 7 | import ReactSixteenAdapter from 'enzyme-adapter-react-16' 8 | 9 | import { createForm } from './utils' 10 | 11 | Enzyme.configure({ adapter: new ReactSixteenAdapter() }) 12 | 13 | describe('react-input-handler', () => { 14 | 15 | it('persist