Skip to content

Commit eaeae68

Browse files
author
Joe Farro
authored
Fix JS errors on search form dropdowns (#325) (#329)
* Fix JS errors on search form dropdowns (#325) * Fix formatting issue Signed-off-by: Joe Farro <joef@uber.com>
1 parent 5d0e712 commit eaeae68

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

packages/jaeger-ui/src/utils/__snapshots__/redux-form-field-adapter.test.js.snap

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ exports[`reduxFormFieldAdapter not validated input should render as expected 1`]
1010
"error": null,
1111
}
1212
}
13-
onBlur={null}
13+
onBlur={[Function]}
1414
onChange={[Function]}
15-
onFocus={null}
15+
onFocus={[Function]}
1616
prefixCls="ant-input"
1717
type="text"
1818
value="inputValue"
@@ -46,6 +46,7 @@ exports[`reduxFormFieldAdapter validate input should render Popover as invisible
4646
}
4747
onBlur={[Function]}
4848
onChange={[Function]}
49+
onFocus={[Function]}
4950
prefixCls="ant-input"
5051
type="text"
5152
value="inputValue"
@@ -80,6 +81,7 @@ exports[`reduxFormFieldAdapter validate input should render Popover as visible i
8081
}
8182
onBlur={[Function]}
8283
onChange={[Function]}
84+
onFocus={[Function]}
8385
prefixCls="ant-input"
8486
type="text"
8587
value="inputValue"
@@ -109,6 +111,7 @@ exports[`reduxFormFieldAdapter validate input should render as expected when the
109111
}
110112
onBlur={[Function]}
111113
onChange={[Function]}
114+
onFocus={[Function]}
112115
prefixCls="ant-input"
113116
type="text"
114117
value="inputValue"

packages/jaeger-ui/src/utils/redux-form-field-adapter.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import * as React from 'react';
2020

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

23+
const noop = () => {};
24+
2325
export default function reduxFormFieldAdapter({
2426
AntInputComponent,
2527
onChangeAdapter,
@@ -38,8 +40,8 @@ export default function reduxFormFieldAdapter({
3840
'is-invalid': isInvalid,
3941
'AdaptedReduxFormField--isValidatedInput': isValidatedInput,
4042
})}
41-
onBlur={isValidatedInput ? onBlur : null}
42-
onFocus={isValidatedInput ? onFocus : null}
43+
onBlur={isValidatedInput && onBlur ? onBlur : noop}
44+
onFocus={isValidatedInput && onFocus ? onFocus : noop}
4345
onChange={onChangeAdapter ? (...args) => onChange(onChangeAdapter(...args)) : onChange}
4446
value={value}
4547
{...rest}

0 commit comments

Comments
 (0)