From 226617de9da2a67c0b77da5ea82ddc86f1110916 Mon Sep 17 00:00:00 2001 From: Osipov Vladimir Date: Tue, 26 Mar 2019 13:08:12 +0300 Subject: [PATCH] fix(Tag): inside ref --- src/common/Tag/Tag.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/common/Tag/Tag.js b/src/common/Tag/Tag.js index a772406c..4f49a4c1 100644 --- a/src/common/Tag/Tag.js +++ b/src/common/Tag/Tag.js @@ -25,6 +25,7 @@ type TagProps = {| onKeyUp?: (event?: SyntheticKeyboardEvent) => void, onKeyDown?: (event?: SyntheticKeyboardEvent) => void, onSubmit?: () => void, + onScroll?: () => void, options?: Array, placeholder?: string, rows?: number | string, @@ -62,6 +63,7 @@ const COLLECTED_PROPS = [ 'onKeyUp', 'onKeyDown', 'onSubmit', + 'onScroll', 'options', 'placeholder', 'rows', @@ -94,6 +96,7 @@ const HTML_TAGS = [ 'label', 'nav', 'img', + 'pre', ]; const collectProps = (props) => pickBy(props, (value, name) => COLLECTED_PROPS.indexOf(name) !== -1 || /^data-/.test(name)); @@ -108,7 +111,11 @@ class Tag extends PureComponent { const collectedProps = HTML_TAGS.indexOf(TagComponent) === -1 ? props : collectProps(props); - return ; + if (HTML_TAGS.indexOf(TagComponent) !== -1) { + collectedProps.ref = props.insideRef; + } + + return ; } }