@adamjanicki/ui-extended 1.0.3 → 1.0.4

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.
@@ -75,7 +75,7 @@ var Autocomplete = function (props) {
75
75
  setOpen(true);
76
76
  };
77
77
  var handleKeys = function (_a) {
78
- var _b;
78
+ var _b, _c;
79
79
  var code = _a.code;
80
80
  if (code === "Escape") {
81
81
  closeMenu();
@@ -84,13 +84,18 @@ var Autocomplete = function (props) {
84
84
  if (code === "Enter") {
85
85
  var current = onRef.current;
86
86
  if (modulo > 0 && current) {
87
+ // Horrible heuristic to handle links
88
+ // It's terrible, but efficient
89
+ var child = current.firstChild;
90
+ if (child && child.nodeName === "A")
91
+ (_b = child.click) === null || _b === void 0 ? void 0 : _b.call(child);
87
92
  return current.click();
88
93
  }
89
94
  else if (onUnselectedEnter) {
90
95
  onUnselectedEnter();
91
96
  closeMenu();
92
97
  if (!focusOnSelect)
93
- return (_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.blur();
98
+ return (_c = inputRef.current) === null || _c === void 0 ? void 0 : _c.blur();
94
99
  }
95
100
  }
96
101
  if (modulo > 0 && code === "ArrowDown") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamjanicki/ui-extended",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "More advanced UI components and hooks for React in TypeScript",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",