Skip to content

Commit

Permalink
erikras#267 Reserve vertical space by displaying a space errorText
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp91 authored Jul 19, 2018
1 parent 9328e93 commit 59efaec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mapError.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59efaec

Please sign in to comment.