Skip to content

Commit

Permalink
Fix <RangeField /> rule
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga committed Sep 1, 2020
1 parent 7e7611a commit 6d152dd
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,16 @@ interface Props {

export const RangeField = ({ field, euiFieldProps = {}, ...rest }: Props) => {
const { isInvalid, errorMessage } = getFieldValidityAndErrorMessage(field);
const { onChange: onFieldChange } = field;

const onChange = useCallback(
(e: React.ChangeEvent<HTMLInputElement> | React.MouseEvent<HTMLButtonElement>) => {
const event = ({ ...e, value: `${e.currentTarget.value}` } as unknown) as React.ChangeEvent<{
value: string;
}>;
field.onChange(event);
onFieldChange(event);
},
// https://github.com/elastic/kibana/issues/73972
/* eslint-disable-next-line react-hooks/exhaustive-deps */
[field.onChange]
[onFieldChange]
);

return (
Expand Down

0 comments on commit 6d152dd

Please sign in to comment.