Skip to content
This repository was archived by the owner on Jan 21, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/components/Input/__snapshots__/input.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ exports[`Input autoresizing works correctly 1`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readonly={false}
resize="auto"
Expand All @@ -41,6 +42,7 @@ exports[`Input autoresizing works correctly 1`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readOnly={false}
rows={2}
Expand Down Expand Up @@ -76,6 +78,7 @@ exports[`Input autoresizing works correctly 2`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readonly={false}
resize="auto"
Expand All @@ -100,6 +103,7 @@ exports[`Input autoresizing works correctly 2`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readOnly={false}
rows={2}
Expand Down Expand Up @@ -140,6 +144,7 @@ exports[`Input lifecycle works 1`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readonly={false}
resize={false}
Expand All @@ -163,6 +168,7 @@ exports[`Input lifecycle works 1`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readOnly={false}
tabIndex={0}
Expand Down Expand Up @@ -196,6 +202,7 @@ exports[`Input lifecycle works 2`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readonly={false}
resize={false}
Expand All @@ -219,6 +226,7 @@ exports[`Input lifecycle works 2`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readOnly={false}
tabIndex={0}
Expand Down Expand Up @@ -252,6 +260,7 @@ exports[`Input lifecycle works 3`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readonly={false}
resize={false}
Expand All @@ -275,6 +284,7 @@ exports[`Input lifecycle works 3`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readOnly={false}
tabIndex={0}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -336,6 +347,7 @@ exports[`Input renders correctly disabled 1`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readOnly={false}
tabIndex={0}
Expand Down Expand Up @@ -366,6 +378,7 @@ exports[`Input renders correctly readonly 1`] = `
onKeyDown={[Function]}
onKeyPress={[Function]}
onKeyUp={[Function]}
onPaste={[Function]}
placeholder={null}
readOnly={true}
tabIndex={0}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
6 changes: 6 additions & 0 deletions src/components/Input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -360,6 +361,10 @@ Input.propTypes = {
* Callback for `onKeyUp` event
*/
onKeyUp: PropTypes.func,
/**
* Callback for `onPaste` event
*/
onPaste: PropTypes.func,
};

Input.defaultProps = {
Expand All @@ -386,6 +391,7 @@ Input.defaultProps = {
onKeyDown: () => {},
onKeyPress: () => {},
onKeyUp: () => {},
onPaste: () => {},
};

export default Input;