Skip to content

Commit

Permalink
Fix JS errors on search form dropdowns (jaegertracing#325) (jaegertra…
Browse files Browse the repository at this point in the history
…cing#329)

* Fix JS errors on search form dropdowns (jaegertracing#325)
* Fix formatting issue

Signed-off-by: Joe Farro <joef@uber.com>

Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
  • Loading branch information
tiffon committed Feb 15, 2019
1 parent a0ba64f commit 73c480f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ exports[`reduxFormFieldAdapter not validated input should render as expected 1`]
"error": null,
}
}
onBlur={null}
onBlur={[Function]}
onChange={[Function]}
onFocus={null}
onFocus={[Function]}
prefixCls="ant-input"
type="text"
value="inputValue"
Expand Down Expand Up @@ -46,6 +46,7 @@ exports[`reduxFormFieldAdapter validate input should render Popover as invisible
}
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
prefixCls="ant-input"
type="text"
value="inputValue"
Expand Down Expand Up @@ -80,6 +81,7 @@ exports[`reduxFormFieldAdapter validate input should render Popover as visible i
}
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
prefixCls="ant-input"
type="text"
value="inputValue"
Expand Down Expand Up @@ -109,6 +111,7 @@ exports[`reduxFormFieldAdapter validate input should render as expected when the
}
onBlur={[Function]}
onChange={[Function]}
onFocus={[Function]}
prefixCls="ant-input"
type="text"
value="inputValue"
Expand Down
6 changes: 4 additions & 2 deletions packages/jaeger-ui/src/utils/redux-form-field-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import * as React from 'react';

import './redux-form-field-adapter.css';

const noop = () => {};

export default function reduxFormFieldAdapter({
AntInputComponent,
onChangeAdapter,
Expand All @@ -38,8 +40,8 @@ export default function reduxFormFieldAdapter({
'is-invalid': isInvalid,
'AdaptedReduxFormField--isValidatedInput': isValidatedInput,
})}
onBlur={isValidatedInput ? onBlur : null}
onFocus={isValidatedInput ? onFocus : null}
onBlur={isValidatedInput && onBlur ? onBlur : noop}
onFocus={isValidatedInput && onFocus ? onFocus : noop}
onChange={onChangeAdapter ? (...args) => onChange(onChangeAdapter(...args)) : onChange}
value={value}
{...rest}
Expand Down

0 comments on commit 73c480f

Please sign in to comment.