From 59efaec6034b10f77eff9f4916d2f324ed220d9e Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Thu, 19 Jul 2018 23:30:16 +0200 Subject: [PATCH] #267 Reserve vertical space by displaying a space errorText --- src/mapError.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mapError.js b/src/mapError.js index caeb56c..03c340c 100755 --- a/src/mapError.js +++ b/src/mapError.js @@ -13,8 +13,12 @@ const mapError = ({ } : { ...input, ...props } - if (touched && hasHelperText && (error || warning)) { - errorProps.helperText = error || warning + if (hasHelperText) { + if (touched && (error || warning)) { + errorProps.helperText = error || warning + } else { + errorProps.helperText = ' ' // Reserve vertical space for a future error/warning. + } } return errorProps