@edifice.io/react 2.6.11-develop-b2school.20261029144429 → 2.6.11-develop-b2school.20261029150712

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.
@@ -39,7 +39,23 @@ const DropdownItem = ({
39
39
  icon,
40
40
  children
41
41
  ] });
42
- return isFiltered ? /* @__PURE__ */ jsx(DropdownItemHidden, { children: content }) : /* @__PURE__ */ jsx("div", { id, role: "menuitem", style, ref: (el) => itemRefs.current[id] = el, tabIndex: isFocused === id ? 0 : -1, className: dropdownItem, "aria-current": isFocused === id, onClick: handleOnClick, onMouseEnter: onMenuItemMouseEnter, onKeyDown: (event) => onMenuItemKeyDown(event, onClick), ...restProps, children: content });
42
+ return isFiltered ? /* @__PURE__ */ jsx(DropdownItemHidden, { children: content }) : /* @__PURE__ */ jsx(
43
+ "div",
44
+ {
45
+ id,
46
+ role: "menuitem",
47
+ style,
48
+ ref: (el) => itemRefs.current[id] = el,
49
+ tabIndex: isFocused === id ? 0 : -1,
50
+ className: dropdownItem,
51
+ "aria-current": isFocused === id,
52
+ onClick: handleOnClick,
53
+ onMouseEnter: onMenuItemMouseEnter,
54
+ onKeyDown: (event) => onMenuItemKeyDown(event, onClick, type === "action"),
55
+ ...restProps,
56
+ children: content
57
+ }
58
+ );
43
59
  };
44
60
  export {
45
61
  DropdownItem as default
@@ -94,7 +94,7 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
94
94
  const index = Object.values(itemRefs.current).filter((item) => !!item).findIndex((item) => item.id === event.currentTarget.getAttribute("id"));
95
95
  setActiveIndex(index);
96
96
  }
97
- }, onMenuItemKeyDown = useCallback((event, onSuccess) => {
97
+ }, onMenuItemKeyDown = useCallback((event, onSuccess, closeOnSuccess = !0) => {
98
98
  let flag = !1;
99
99
  if (event.shiftKey)
100
100
  event.key === "Tab" && (closeDropdown(), flag = !0);
@@ -105,7 +105,7 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
105
105
  break;
106
106
  case " ":
107
107
  case "Enter":
108
- activeIndex !== -1 && (Object.values(itemRefs.current)[activeIndex].getAttribute("role") === "menuitem" && triggerRef.current && (triggerRef.current.focus(), setVisible(!1)), onSuccess == null || onSuccess()), flag = !0;
108
+ activeIndex !== -1 && (Object.values(itemRefs.current).filter(Boolean)[activeIndex].getAttribute("role") === "menuitem" && closeOnSuccess && triggerRef.current && (triggerRef.current.focus(), setVisible(!1)), onSuccess == null || onSuccess()), flag = !0;
109
109
  break;
110
110
  case "ArrowDown":
111
111
  case "Down":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.6.11-develop-b2school.20261029144429",
3
+ "version": "2.6.11-develop-b2school.20261029150712",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -140,9 +140,9 @@
140
140
  "swiper": "10.1.0",
141
141
  "ua-parser-js": "1.0.36",
142
142
  "zustand": "4.5.7",
143
- "@edifice.io/bootstrap": "2.6.11-develop-b2school.20261029144429",
144
- "@edifice.io/tiptap-extensions": "2.6.11-develop-b2school.20261029144429",
145
- "@edifice.io/utilities": "2.6.11-develop-b2school.20261029144429"
143
+ "@edifice.io/bootstrap": "2.6.11-develop-b2school.20261029150712",
144
+ "@edifice.io/tiptap-extensions": "2.6.11-develop-b2school.20261029150712",
145
+ "@edifice.io/utilities": "2.6.11-develop-b2school.20261029150712"
146
146
  },
147
147
  "devDependencies": {
148
148
  "@babel/plugin-transform-react-pure-annotations": "7.27.1",
@@ -174,8 +174,8 @@
174
174
  "vite": "5.4.14",
175
175
  "vite-plugin-dts": "4.5.4",
176
176
  "vite-tsconfig-paths": "5.1.4",
177
- "@edifice.io/config": "2.6.11-develop-b2school.20261029144429",
178
- "@edifice.io/client": "2.6.11-develop-b2school.20261029144429"
177
+ "@edifice.io/client": "2.6.11-develop-b2school.20261029150712",
178
+ "@edifice.io/config": "2.6.11-develop-b2school.20261029150712"
179
179
  },
180
180
  "peerDependencies": {
181
181
  "@react-spring/web": "9.7.5",