wini-web-components 1.2.0 → 1.2.2

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.
@@ -107,15 +107,16 @@ var Select1 = /** @class */ (function (_super) {
107
107
  _this.onKeyDown = function (ev) {
108
108
  var _a, _b, _c, _d, _e, _f, _g;
109
109
  console.log(ev.key);
110
- ev.preventDefault();
111
110
  if ((((_a = _this.state.options) === null || _a === void 0 ? void 0 : _a.length) || ((_b = _this.state.search) === null || _b === void 0 ? void 0 : _b.length)) && _this.state.isOpen) {
112
111
  switch (ev.key.toLowerCase()) {
113
112
  case "enter":
113
+ ev.preventDefault();
114
114
  var _selectItem = ((_c = _this.state.search) !== null && _c !== void 0 ? _c : _this.state.options).find(function (e) { return e.id === _this.state.selected; });
115
115
  if (_selectItem)
116
116
  _this.onSelect(_selectItem);
117
117
  break;
118
118
  case "arrowup":
119
+ ev.preventDefault();
119
120
  if (_this.state.selected) {
120
121
  var _index = ((_d = _this.state.search) !== null && _d !== void 0 ? _d : _this.state.options).findIndex(function (e) { return e.id === _this.state.selected; });
121
122
  _index = ((_index === 0) ? _this.props.options.length : _index) - 1;
@@ -123,6 +124,7 @@ var Select1 = /** @class */ (function (_super) {
123
124
  }
124
125
  break;
125
126
  case "arrowdown":
127
+ ev.preventDefault();
126
128
  if (_this.state.selected) {
127
129
  var _index = ((_f = _this.state.search) !== null && _f !== void 0 ? _f : _this.state.options).findIndex(function (e) { return e.id === _this.state.selected; });
128
130
  _index = ((_index + 1 === _this.props.options.length) ? -1 : _index) + 1;
@@ -275,7 +277,7 @@ var Select1 = /** @class */ (function (_super) {
275
277
  react_1.default.createElement("div", { className: 'row', style: { flexWrap: 'wrap', flex: 1, width: '100%', gap: '0.6rem 0.4rem' } }, (!_value || typeof _value.name === "string" || typeof _value.name === "number") ? react_1.default.createElement("input", { ref: this.inputRef, readOnly: this.props.readOnly, onChange: this.search, placeholder: this.props.placeholder, onKeyDown: this.onKeyDown, onBlur: function (ev) {
276
278
  if (_this.state.onSelect && !_this.props.readOnly)
277
279
  ev.target.focus();
278
- else
280
+ else if (!_this.state.onSelect)
279
281
  _this.setState(__assign(__assign({}, _this.state), { isOpen: false, onSelect: null }));
280
282
  } }) : _value.name),
281
283
  this.props.showClearValueButton && react_1.default.createElement("button", { type: 'button', className: 'row', style: { padding: '0.4rem' }, onClick: function (ev) {