From b438eed70de07a1586cfae26b60b6bacb256f935 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Tue, 13 Aug 2019 17:42:21 -0400 Subject: [PATCH] formik-input can set ref to its inner input --- src/components/formik-forms/formik-input.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/formik-forms/formik-input.jsx b/src/components/formik-forms/formik-input.jsx index 908fc8890..6b37790eb 100644 --- a/src/components/formik-forms/formik-input.jsx +++ b/src/components/formik-forms/formik-input.jsx @@ -11,6 +11,7 @@ require('./formik-input.scss'); const FormikInput = ({ className, error, + setRef, toolTip, validationClassName, wrapperClassName, @@ -30,6 +31,8 @@ const FormikInput = ({ {fail: error}, className )} + /* formik uses "innerRef" to return the actual input element */ + innerRef={setRef} {...props} /> {error ? ( @@ -48,10 +51,10 @@ const FormikInput = ({ ); - FormikInput.propTypes = { className: PropTypes.string, error: PropTypes.string, + setRef: PropTypes.func, toolTip: PropTypes.string, type: PropTypes.string, validationClassName: PropTypes.string,