Added onKeyDown prop to Input comp
This commit is contained in:
parent
64abfd4408
commit
767784a79c
1 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,7 @@ function Input({
|
||||||
id, label, value, placeholder,
|
id, label, value, placeholder,
|
||||||
required, type, onChange, forwardRef,
|
required, type, onChange, forwardRef,
|
||||||
resizable, minHeight, onResize, state,
|
resizable, minHeight, onResize, state,
|
||||||
|
onKeyDown,
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className="input-container">
|
<div className="input-container">
|
||||||
|
@ -26,6 +27,7 @@ function Input({
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
onResize={onResize}
|
onResize={onResize}
|
||||||
|
onKeyDown={onKeyDown}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<input
|
<input
|
||||||
|
@ -38,6 +40,7 @@ function Input({
|
||||||
defaultValue={value}
|
defaultValue={value}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
|
onKeyDown={onKeyDown}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -57,6 +60,7 @@ Input.defaultProps = {
|
||||||
minHeight: 46,
|
minHeight: 46,
|
||||||
onResize: null,
|
onResize: null,
|
||||||
state: 'normal',
|
state: 'normal',
|
||||||
|
onKeyDown: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
Input.propTypes = {
|
Input.propTypes = {
|
||||||
|
@ -72,6 +76,7 @@ Input.propTypes = {
|
||||||
minHeight: PropTypes.number,
|
minHeight: PropTypes.number,
|
||||||
onResize: PropTypes.func,
|
onResize: PropTypes.func,
|
||||||
state: PropTypes.oneOf(['normal', 'success', 'error']),
|
state: PropTypes.oneOf(['normal', 'success', 'error']),
|
||||||
|
onKeyDown: PropTypes.func,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Input;
|
export default Input;
|
||||||
|
|
Loading…
Reference in a new issue