Commit e40d2145 by Torkel Ödegaard

fixing input unit test failure

parent 42ee81a9
import React, { PureComponent } from 'react';
import classNames from 'classnames';
import { ValidationEvents, ValidationRule } from 'app/types';
import { validate, hasValidationEvent } from 'app/core/utils/validate';
......@@ -80,7 +81,7 @@ export class Input extends PureComponent<Props> {
render() {
const { validationEvents, className, hideErrorMessage, ...restProps } = this.props;
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);
return (
......
......@@ -36,25 +36,25 @@ export default class UnitPicker extends PureComponent<Props> {
};
});
const styles = {
...ResetStyles,
menu: () => ({
maxHeight: '75%',
overflow: 'scroll',
}),
menuList: () =>
({
overflowY: 'auto',
position: 'relative',
} as React.CSSProperties),
valueContainer: () =>
({
overflow: 'hidden',
textOverflow: 'ellipsis',
maxWidth: '90px',
whiteSpace: 'nowrap',
} as React.CSSProperties),
};
// const styles = {
// ...ResetStyles,
// menu: () => ({
// maxHeight: '75%',
// overflow: 'scroll',
// }),
// menuList: () =>
// ({
// overflowY: 'auto',
// position: 'relative',
// } as React.CSSProperties),
// valueContainer: () =>
// ({
// overflow: 'hidden',
// textOverflow: 'ellipsis',
// maxWidth: '90px',
// whiteSpace: 'nowrap',
// } as React.CSSProperties),
// };
const value = groupOptions.map(group => {
return group.options.find(option => option.value === defaultValue);
......@@ -74,7 +74,7 @@ export default class UnitPicker extends PureComponent<Props> {
Group: UnitGroup,
Option: UnitOption,
}}
styles={styles}
styles={ResetStyles}
/>
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment