Skip to content
This repository has been archived by the owner on Feb 12, 2018. It is now read-only.

Latest commit

 

History

History
28 lines (19 loc) · 699 Bytes

README.md

File metadata and controls

28 lines (19 loc) · 699 Bytes

capture-submit

THIS IS NO LONGER MAINTAINED USE @scienceai/ui INSTEAD

styled with prettier

React higher order component that calls a onSubmit callback on blur, pressing enter etc...

import CaptureSubmit from 'capture-submit';
import PaperInput from 'paper-input';

const ControlledPaperInput = CaptureSubmit(PaperInput);

...


<ControlledPaperInput
 type="text"
 name="name"
 label="name"
 value="value"
 onSubmit={(e) => { console.log('submission! (blur, enter is pressed etc..')}}
/>

capture-submit will do the right thing for select input and textarea (see sources).