Add classname for required fields.

This commit is contained in:
Valentin Boettcher 2019-02-27 12:03:14 +01:00 committed by GitHub
parent 4261470fad
commit 2290f4cca0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ export class AccountsField extends PureComponent {
label,
type = 'text',
onChange,
// required = false,
required = false,
className = 'field',
defaultValue = '',
message,
@ -59,7 +59,9 @@ export class AccountsField extends PureComponent {
}
const autoComplete = autocompleteValues[id];
if(required)
className += ' required';
return mount ? (
<div className={ className } style={{marginBottom: '10px'}}>
<Components.FormControl id={ id } type={ type } inputRef={ref => { this.input = ref; }} onChange={ onChange } placeholder={ hint } defaultValue={ defaultValue } autoComplete={autoComplete }/>
@ -75,4 +77,4 @@ AccountsField.propTypes = {
onChange: PropTypes.func
};
registerComponent('AccountsField', AccountsField);
registerComponent('AccountsField', AccountsField);