update checkbox / radio input styles

This commit is contained in:
btzr-io 2017-10-14 16:37:40 -06:00
parent b6b23b5583
commit ac95dea827
3 changed files with 10 additions and 3 deletions

View file

@ -106,12 +106,10 @@ export class FormRow extends React.PureComponent {
} }
onFocus() { onFocus() {
//this._field.focus();
this.setState({ isFocus: true }); this.setState({ isFocus: true });
} }
onBlur() { onBlur() {
//this._field.focus();
this.setState({ isFocus: false }); this.setState({ isFocus: false });
} }

View file

@ -134,6 +134,8 @@ class FormField extends React.PureComponent {
renderElementInsideLabel = renderElementInsideLabel =
this.props.label && formFieldNestedLabelTypes.includes(this.props.type); this.props.label && formFieldNestedLabelTypes.includes(this.props.type);
const isCheck = this.refs.field && this.refs.field.checked ? true : false;
delete otherProps.type; delete otherProps.type;
delete otherProps.label; delete otherProps.label;
delete otherProps.hasError; delete otherProps.hasError;
@ -177,7 +179,8 @@ class FormField extends React.PureComponent {
htmlFor={elementId} htmlFor={elementId}
className={ className={
"form-field__label " + "form-field__label " +
(isError ? "form-field__label--error" : "") (isError ? "form-field__label--error" : "") +
(isCheck ? " checked" : "")
} }
> >
{element} {element}

View file

@ -155,6 +155,12 @@ input[readonly]:focus {
color: var(--color-primary) !important; color: var(--color-primary) !important;
} }
&.checked {
color: var(--text-color) !important;
}
} }
.form-row__label-row .form-field__label--error { .form-row__label-row .form-field__label--error {