diff --git a/src/components/Input/__snapshots__/input.spec.js.snap b/src/components/Input/__snapshots__/input.spec.js.snap index 27e3fc9..df95198 100644 --- a/src/components/Input/__snapshots__/input.spec.js.snap +++ b/src/components/Input/__snapshots__/input.spec.js.snap @@ -17,6 +17,7 @@ exports[`Input autoresizing works correctly 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readonly={false} resize="auto" @@ -41,6 +42,7 @@ exports[`Input autoresizing works correctly 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} rows={2} @@ -76,6 +78,7 @@ exports[`Input autoresizing works correctly 2`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readonly={false} resize="auto" @@ -100,6 +103,7 @@ exports[`Input autoresizing works correctly 2`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} rows={2} @@ -140,6 +144,7 @@ exports[`Input lifecycle works 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readonly={false} resize={false} @@ -163,6 +168,7 @@ exports[`Input lifecycle works 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -196,6 +202,7 @@ exports[`Input lifecycle works 2`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readonly={false} resize={false} @@ -219,6 +226,7 @@ exports[`Input lifecycle works 2`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -252,6 +260,7 @@ exports[`Input lifecycle works 3`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readonly={false} resize={false} @@ -275,6 +284,7 @@ exports[`Input lifecycle works 3`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -306,6 +316,7 @@ exports[`Input renders correctly all the standard params 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -336,6 +347,7 @@ exports[`Input renders correctly disabled 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -366,6 +378,7 @@ exports[`Input renders correctly readonly 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={true} tabIndex={0} @@ -396,6 +409,7 @@ exports[`Input renders correctly with a placeholder 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder="That's a placeholder" readOnly={false} tabIndex={0} @@ -426,6 +440,7 @@ exports[`Input renders correctly with an error status and a hint 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -461,6 +476,7 @@ exports[`Input renders correctly with custom class names 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -491,6 +507,7 @@ exports[`Input renders correctly with default values 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -521,6 +538,7 @@ exports[`Input renders correctly with different types 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -551,6 +569,7 @@ exports[`Input renders correctly with different types 2`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -581,6 +600,7 @@ exports[`Input renders correctly with different types 3`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -611,6 +631,7 @@ exports[`Input renders correctly with different types 4`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -641,6 +662,7 @@ exports[`Input renders correctly with different types 5`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -671,6 +693,7 @@ exports[`Input renders correctly with different types 6`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -701,6 +724,7 @@ exports[`Input renders correctly with different types 7`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={0} @@ -731,6 +755,7 @@ exports[`Input renders correctly with multiline 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} rows={3} @@ -763,6 +788,7 @@ exports[`Input renders correctly with multiline 2`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} rows={3} @@ -795,6 +821,7 @@ exports[`Input renders correctly with tabIndex 1`] = ` onKeyDown={[Function]} onKeyPress={[Function]} onKeyUp={[Function]} + onPaste={[Function]} placeholder={null} readOnly={false} tabIndex={-2} diff --git a/src/components/Input/index.js b/src/components/Input/index.js index ab545d1..21b7f43 100644 --- a/src/components/Input/index.js +++ b/src/components/Input/index.js @@ -100,6 +100,7 @@ class Input extends React.Component { onKeyUp: this.props.onKeyUp, onKeyDown: this.props.onKeyDown, onKeyPress: this.props.onKeyPress, + onPaste: this.props.onPaste, readOnly: this.props.readonly, disabled: this.props.disabled, tabIndex: this.props.tabIndex, @@ -360,6 +361,10 @@ Input.propTypes = { * Callback for `onKeyUp` event */ onKeyUp: PropTypes.func, + /** + * Callback for `onPaste` event + */ + onPaste: PropTypes.func, }; Input.defaultProps = { @@ -386,6 +391,7 @@ Input.defaultProps = { onKeyDown: () => {}, onKeyPress: () => {}, onKeyUp: () => {}, + onPaste: () => {}, }; export default Input;