utopia-ui 3.0.0-alpha.244 → 3.0.0-alpha.246

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.
package/dist/index.js CHANGED
@@ -4647,6 +4647,7 @@ var Autocomplete = function (_a) {
4647
4647
  onSelected(suggestion);
4648
4648
  }
4649
4649
  var handleKeyDown = function (event) {
4650
+ event.preventDefault();
4650
4651
  switch (event.key) {
4651
4652
  case 'ArrowDown':
4652
4653
  heighlightedSuggestion < filteredSuggestions.length - 1 && setHeighlightedSuggestion(function (current) { return current + 1; });
@@ -4655,7 +4656,6 @@ var Autocomplete = function (_a) {
4655
4656
  heighlightedSuggestion > 0 && setHeighlightedSuggestion(function (current) { return current - 1; });
4656
4657
  break;
4657
4658
  case 'Enter':
4658
- event.preventDefault();
4659
4659
  if (filteredSuggestions.length > 0) {
4660
4660
  onSelected(filteredSuggestions[heighlightedSuggestion]);
4661
4661
  setHeighlightedSuggestion(0);
@@ -4667,7 +4667,7 @@ var Autocomplete = function (_a) {
4667
4667
  break;
4668
4668
  }
4669
4669
  };
4670
- return (jsxs("div", { children: [jsx("input", __assign({ ref: inputRef }, inputProps, { type: "text", onChange: function (e) { return handleChange(e); }, onKeyDown: handleKeyDown })), jsx("ul", __assign({ className: "tw-absolute tw-z-[4000] ".concat(filteredSuggestions.length > 0 && 'tw-bg-base-100 tw-rounded-xl tw-p-2') }, { children: filteredSuggestions.map(function (suggestion, index) { return (jsx("li", __assign({ onClick: function () { return handleSuggestionClick(suggestion); } }, { children: jsx(TagView, { heighlight: index == heighlightedSuggestion, tag: suggestion }) }), index)); }) }))] }));
4670
+ return (jsxs("div", { children: [jsx("input", __assign({ ref: inputRef }, inputProps, { type: "text", onChange: function (e) { return handleChange(e); }, tabindex: "-1", onKeyDown: handleKeyDown })), jsx("ul", __assign({ className: "tw-absolute tw-z-[4000] ".concat(filteredSuggestions.length > 0 && 'tw-bg-base-100 tw-rounded-xl tw-p-2') }, { children: filteredSuggestions.map(function (suggestion, index) { return (jsx("li", __assign({ onClick: function () { return handleSuggestionClick(suggestion); } }, { children: jsx(TagView, { heighlight: index == heighlightedSuggestion, tag: suggestion }) }), index)); }) }))] }));
4671
4671
  };
4672
4672
 
4673
4673
  var TagsWidget = function (_a) {