|
@@ -1,4 +1,5 @@
|
|
|
import React, { PureComponent } from 'react';
|
|
import React, { PureComponent } from 'react';
|
|
|
|
|
+import classNames from 'classnames';
|
|
|
import { ValidationEvents, ValidationRule } from 'app/types';
|
|
import { ValidationEvents, ValidationRule } from 'app/types';
|
|
|
import { validate, hasValidationEvent } from 'app/core/utils/validate';
|
|
import { validate, hasValidationEvent } from 'app/core/utils/validate';
|
|
|
|
|
|
|
@@ -80,7 +81,7 @@ export class Input extends PureComponent<Props> {
|
|
|
render() {
|
|
render() {
|
|
|
const { validationEvents, className, hideErrorMessage, ...restProps } = this.props;
|
|
const { validationEvents, className, hideErrorMessage, ...restProps } = this.props;
|
|
|
const { error } = this.state;
|
|
const { error } = this.state;
|
|
|
- const inputClassName = 'gf-form-input' + (this.isInvalid ? ' invalid' : '') + ' ' + className;
|
|
|
|
|
|
|
+ const inputClassName = classNames('gf-form-input', { invalid: this.isInvalid }, className);
|
|
|
const inputElementProps = this.populateEventPropsWithStatus(restProps, validationEvents);
|
|
const inputElementProps = this.populateEventPropsWithStatus(restProps, validationEvents);
|
|
|
|
|
|
|
|
return (
|
|
return (
|