twisty / formsy-react-components

Bootstrap components for a formsy-react form.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validation error not shown when layout=elementOnly

rodryquintero opened this issue · comments

Just noticed this. The error class is applied to the containing div and not the element.

Noted. Not sure if this is desired behaviour or not... I really need to relook at the use-case for including the element-only layout mode and document it!

Going to close this. I think elementOnly layout should literally be just that.

You could still get validation classes and errors by using one of the other layouts modes, and then hiding the bits you don't want with CSS.

Example: hide the label

.control-label {
    display: none;
}

Hide just the help text:

.help-block {
    display: none;
}
.help-block.validation-message {
    display: inherit;
}

Hide just the validation messages:

.help-block.validation-message {
    display: none;
}