From 5097395258d62a1c82f64f17c1833a4dbfc0f015 Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Fri, 18 May 2018 22:23:25 +0300 Subject: [PATCH] add condition for input rerender --- web/app/components/input/input.jsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/app/components/input/input.jsx b/web/app/components/input/input.jsx index 0228ea40..cbce5e05 100644 --- a/web/app/components/input/input.jsx +++ b/web/app/components/input/input.jsx @@ -46,6 +46,13 @@ export default class Input extends Component { }); } + shouldComponentUpdate(nextProps) { + return nextProps.id !== this.props.id + || nextProps.pid !== this.props.pid + || nextProps.value !== this.props.value + || nextProps.errorMessage !== this.props.errorMessage; + } + onKeyDown(e) { // send on cmd+enter / ctrl+enter if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) {