diff --git a/src/components/Form.js b/src/components/Form.js index a7379152bb9..9ab4e57da39 100644 --- a/src/components/Form.js +++ b/src/components/Form.js @@ -277,7 +277,6 @@ class Form extends React.Component { ref: (node) => { this.inputRefs[inputID] = node; - // Call the original ref, if any const {ref} = child; if (_.isFunction(ref)) { ref(node); @@ -285,7 +284,7 @@ class Form extends React.Component { }, value: this.state.inputValues[inputID], errorText: this.state.errors[inputID] || fieldErrorMessage, - onBlur: () => { + onBlur: (event) => { // We delay the validation in order to prevent Checkbox loss of focus when // the user are focusing a TextInput and proceeds to toggle a CheckBox in // web and mobile web platforms. @@ -293,6 +292,10 @@ class Form extends React.Component { this.setTouchedInput(inputID); this.validate(this.state.inputValues); }, 200); + + if (_.isFunction(child.props.onBlur)) { + child.props.onBlur(event); + } }, onInputChange: (value, key) => { const inputKey = key || inputID; diff --git a/src/components/Hoverable/index.js b/src/components/Hoverable/index.js index 2f10cca0c1e..12145b93b26 100644 --- a/src/components/Hoverable/index.js +++ b/src/components/Hoverable/index.js @@ -69,19 +69,15 @@ class Hoverable extends Component { onMouseEnter: (el) => { this.setIsHovered(true); - // Call the original onMouseEnter, if any - const {onMouseEnter} = this.props.children; - if (_.isFunction(onMouseEnter)) { - onMouseEnter(el); + if (_.isFunction(this.props.children.props.onMouseEnter)) { + this.props.children.props.onMouseEnter(el); } }, onMouseLeave: (el) => { this.setIsHovered(false); - // Call the original onMouseLeave, if any - const {onMouseLeave} = this.props.children; - if (_.isFunction(onMouseLeave)) { - onMouseLeave(el); + if (_.isFunction(this.props.children.props.onMouseLeave)) { + this.props.children.props.onMouseLeave(el); } }, onBlur: (el) => { @@ -89,10 +85,8 @@ class Hoverable extends Component { this.setIsHovered(false); } - // Call the original onBlur, if any - const {onBlur} = this.props.children; - if (_.isFunction(onBlur)) { - onBlur(el); + if (_.isFunction(this.props.children.props.onBlur)) { + this.props.children.props.onBlur(el); } }, }); diff --git a/src/components/Tooltip/index.js b/src/components/Tooltip/index.js index 104098b375f..b84fbd6cb0e 100644 --- a/src/components/Tooltip/index.js +++ b/src/components/Tooltip/index.js @@ -172,10 +172,8 @@ class Tooltip extends PureComponent { onBlur: (el) => { this.hideTooltip(); - // Call the original onBlur, if any - const {onBlur} = this.props.children; - if (_.isFunction(onBlur)) { - onBlur(el); + if (_.isFunction(this.props.children.props.onBlur)) { + this.props.children.props.onBlur(el); } }, focusable: true,