@skygraph/react 0.5.0 → 0.5.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.
package/dist/index.cjs CHANGED
@@ -11526,13 +11526,21 @@ function Dropdown({
11526
11526
  break;
11527
11527
  case "ArrowDown":
11528
11528
  e.preventDefault();
11529
- if (!open) setOpen(true);
11530
- else setFocusedIndex((i) => getNextMenuIndex(i, 1));
11529
+ if (!open) {
11530
+ setOpen(true);
11531
+ setFocusedIndex(getNextMenuIndex(-1, 1));
11532
+ } else {
11533
+ setFocusedIndex((i) => getNextMenuIndex(i, 1));
11534
+ }
11531
11535
  break;
11532
11536
  case "ArrowUp":
11533
11537
  e.preventDefault();
11534
- if (!open) setOpen(true);
11535
- else setFocusedIndex((i) => getNextMenuIndex(i, -1));
11538
+ if (!open) {
11539
+ setOpen(true);
11540
+ setFocusedIndex(getNextMenuIndex(items2.length, -1));
11541
+ } else {
11542
+ setFocusedIndex((i) => getNextMenuIndex(i, -1));
11543
+ }
11536
11544
  break;
11537
11545
  case "Home":
11538
11546
  if (open) {
@@ -11549,12 +11557,20 @@ function Dropdown({
11549
11557
  }
11550
11558
  };
11551
11559
  if (unstyled) {
11552
- return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { ref, className, style: { position: "relative", display: "inline-block" }, children: [
11553
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children }),
11554
- open && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: items2.map(
11555
- (item) => item.divider ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("hr", {}, item.key) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { onClick: () => handleSelect(item), children: item.label }, item.key)
11556
- ) })
11557
- ] });
11560
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
11561
+ "div",
11562
+ {
11563
+ ref,
11564
+ className,
11565
+ style: { position: "relative", display: "inline-block" },
11566
+ children: [
11567
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { onClick: handleClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children }),
11568
+ open && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: items2.map(
11569
+ (item) => item.divider ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("hr", {}, item.key) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { onClick: () => handleSelect(item), children: item.label }, item.key)
11570
+ ) })
11571
+ ]
11572
+ }
11573
+ );
11558
11574
  }
11559
11575
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
11560
11576
  "div",