@imposium-hub/components 1.38.1 → 1.38.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,8 @@ interface IListFieldProps {
18
18
  width? : string | number;
19
19
  onChange(e) : void;
20
20
  onError(e) : void;
21
+ onFocus? : () => void;
22
+ onBlur? : () => void;
21
23
  info? : string;
22
24
  labelPosition? : string;
23
25
  }
@@ -61,6 +63,9 @@ class ListField extends React.PureComponent<IListFieldProps, IListFieldState> {
61
63
  private inputBlur(e) {
62
64
 
63
65
  hotkeys.unbind('enter', this.submitHandler);
66
+ if (this.props.onBlur) {
67
+ this.props.onBlur();
68
+ }
64
69
  }
65
70
 
66
71
  private inputChanged(e) {
@@ -72,10 +77,9 @@ class ListField extends React.PureComponent<IListFieldProps, IListFieldState> {
72
77
 
73
78
  private inputFocus(e) {
74
79
 
75
- const input = this.inputRef.current;
76
-
77
- if (input) {
78
- hotkeys('enter', this.submitHandler);
80
+ hotkeys('enter', this.submitHandler);
81
+ if (this.props.onFocus) {
82
+ this.props.onFocus();
79
83
  }
80
84
  }
81
85
 
@@ -162,7 +166,7 @@ class ListField extends React.PureComponent<IListFieldProps, IListFieldState> {
162
166
  style = 'subtle'
163
167
  tooltip = {tooltipAdd}
164
168
  color = 'primary'
165
- onClick = {() => this.submitOption()}>
169
+ onClick = {this.submitHandler}>
166
170
  {ICON_PLUS}
167
171
  </Button>);
168
172