From d507705bfa68aa87123699b16b3743105c1c2389 Mon Sep 17 00:00:00 2001 From: Dmitriy Rozhkov Date: Mon, 18 Feb 2019 15:39:48 +0100 Subject: [PATCH 1/2] fix: check if DOM node exists --- src/Form/FieldInput.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Form/FieldInput.js b/src/Form/FieldInput.js index 9d5104c57..ce89c5f1c 100644 --- a/src/Form/FieldInput.js +++ b/src/Form/FieldInput.js @@ -66,7 +66,11 @@ class FieldInput extends Util.mixin(BindMixin) { props.handleSubmit(); } - ReactDOM.findDOMNode(this.inputElementRef.current).blur(); + const inputNode = ReactDOM.findDOMNode(this.inputElementRef.current); + + if(inputNode) { + ReactDOM.findDOMNode(this.inputElementRef.current).blur(); + } } } From 7b6e211fd725a50d245d248f25ea5cd8b57857d4 Mon Sep 17 00:00:00 2001 From: Dmitriy Rozhkov Date: Mon, 18 Feb 2019 15:50:00 +0100 Subject: [PATCH 2/2] chore: prettier --- src/Form/FieldInput.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Form/FieldInput.js b/src/Form/FieldInput.js index ce89c5f1c..dfa7778b4 100644 --- a/src/Form/FieldInput.js +++ b/src/Form/FieldInput.js @@ -68,8 +68,8 @@ class FieldInput extends Util.mixin(BindMixin) { const inputNode = ReactDOM.findDOMNode(this.inputElementRef.current); - if(inputNode) { - ReactDOM.findDOMNode(this.inputElementRef.current).blur(); + if (inputNode) { + inputNode.blur(); } } }