@luomus/laji-form 15.1.53 → 15.1.54

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.
@@ -1026,7 +1026,8 @@ class ReactAutosuggest extends React.Component {
1026
1026
  this.onBlur(e);
1027
1027
  };
1028
1028
  this.onInputKeyDown = (e) => {
1029
- let state, suggestion;
1029
+ var _a, _b;
1030
+ let state;
1030
1031
  switch (e.key) {
1031
1032
  case "ArrowDown":
1032
1033
  e.preventDefault();
@@ -1056,10 +1057,7 @@ class ReactAutosuggest extends React.Component {
1056
1057
  break;
1057
1058
  case "Enter":
1058
1059
  e.preventDefault();
1059
- suggestion = (this.props.suggestions || [])[this.state.focusedIdx];
1060
- if (suggestion) {
1061
- this.onSuggestionSelected(suggestion);
1062
- }
1060
+ this.inputElem.blur();
1063
1061
  break;
1064
1062
  case "Control":
1065
1063
  case "Meta":
@@ -1070,7 +1068,7 @@ class ReactAutosuggest extends React.Component {
1070
1068
  default:
1071
1069
  this.setState({ touched: true });
1072
1070
  }
1073
- this.props.inputProps && this.props.inputProps.onKeyDown && this.props.inputProps.onKeyDown(e);
1071
+ (_b = (_a = this.props.inputProps) === null || _a === void 0 ? void 0 : _a.onKeyDown) === null || _b === void 0 ? void 0 : _b.call(_a, e);
1074
1072
  };
1075
1073
  this.onInputChange = (e) => {
1076
1074
  this._onInputChange(e.target.value, "keystroke");
@@ -1121,13 +1119,14 @@ class ReactAutosuggest extends React.Component {
1121
1119
  this.renderSuggestions()));
1122
1120
  }
1123
1121
  onBlur(e) {
1122
+ var _a, _b;
1124
1123
  if (e.relatedTarget && e.relatedTarget === react_dom_1.findDOMNode(this.listRef.current)) {
1125
1124
  return;
1126
1125
  }
1127
1126
  const suggestion = (this.props.suggestions || [])[this.state.focusedIdx];
1128
1127
  suggestion && this.onSuggestionSelected(this.props.suggestions[this.state.focusedIdx]);
1129
1128
  this.setState({ focused: false, focusedIdx: undefined, touched: false });
1130
- this.props.inputProps && this.props.inputProps.onBlur && this.props.inputProps.onBlur(e);
1129
+ (_b = (_a = this.props.inputProps) === null || _a === void 0 ? void 0 : _a.onBlur) === null || _b === void 0 ? void 0 : _b.call(_a, e);
1131
1130
  }
1132
1131
  renderInput() {
1133
1132
  const { inputProps, renderInputComponent = this.renderDefaultInputComponent } = this.props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luomus/laji-form",
3
- "version": "15.1.53",
3
+ "version": "15.1.54",
4
4
  "description": "React module capable of building dynamic forms from Laji form json schemas",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",