@nurix/ui-component-library 1.1.4-stage.126 → 1.1.4-stage.127

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
@@ -10180,15 +10180,25 @@ var SelectContent = React21.forwardRef(
10180
10180
  const handleSearchBlur = React21.useCallback(
10181
10181
  (e) => {
10182
10182
  const next = e.relatedTarget;
10183
- if ((next == null ? void 0 : next.getAttribute("role")) === "option") {
10184
- requestAnimationFrame(() => {
10185
- var _a5;
10186
- (_a5 = searchInputRef.current) == null ? void 0 : _a5.focus({ preventScroll: true });
10187
- });
10188
- }
10183
+ const isSelectItem = (next == null ? void 0 : next.getAttribute("role")) === "option";
10184
+ if (!isSelectItem && next !== null) return;
10185
+ requestAnimationFrame(() => {
10186
+ var _a5;
10187
+ (_a5 = searchInputRef.current) == null ? void 0 : _a5.focus({ preventScroll: true });
10188
+ });
10189
10189
  },
10190
10190
  []
10191
10191
  );
10192
+ React21.useEffect(() => {
10193
+ if (!searchInputRef.current) return;
10194
+ const id = requestAnimationFrame(() => {
10195
+ var _a5;
10196
+ if (document.activeElement !== searchInputRef.current) {
10197
+ (_a5 = searchInputRef.current) == null ? void 0 : _a5.focus({ preventScroll: true });
10198
+ }
10199
+ });
10200
+ return () => cancelAnimationFrame(id);
10201
+ }, [searchQuery]);
10192
10202
  const content = items ? isSectionArray(items) ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_jsx_runtime19.Fragment, { children: filteredItems.map(
10193
10203
  (section, sectionIdx) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(SelectGroup, { children: [
10194
10204
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(SelectLabel, { children: section.sectionLabel }),
package/dist/index.mjs CHANGED
@@ -10072,15 +10072,25 @@ var SelectContent = React21.forwardRef(
10072
10072
  const handleSearchBlur = React21.useCallback(
10073
10073
  (e) => {
10074
10074
  const next = e.relatedTarget;
10075
- if ((next == null ? void 0 : next.getAttribute("role")) === "option") {
10076
- requestAnimationFrame(() => {
10077
- var _a5;
10078
- (_a5 = searchInputRef.current) == null ? void 0 : _a5.focus({ preventScroll: true });
10079
- });
10080
- }
10075
+ const isSelectItem = (next == null ? void 0 : next.getAttribute("role")) === "option";
10076
+ if (!isSelectItem && next !== null) return;
10077
+ requestAnimationFrame(() => {
10078
+ var _a5;
10079
+ (_a5 = searchInputRef.current) == null ? void 0 : _a5.focus({ preventScroll: true });
10080
+ });
10081
10081
  },
10082
10082
  []
10083
10083
  );
10084
+ React21.useEffect(() => {
10085
+ if (!searchInputRef.current) return;
10086
+ const id = requestAnimationFrame(() => {
10087
+ var _a5;
10088
+ if (document.activeElement !== searchInputRef.current) {
10089
+ (_a5 = searchInputRef.current) == null ? void 0 : _a5.focus({ preventScroll: true });
10090
+ }
10091
+ });
10092
+ return () => cancelAnimationFrame(id);
10093
+ }, [searchQuery]);
10084
10094
  const content = items ? isSectionArray(items) ? /* @__PURE__ */ jsx19(Fragment5, { children: filteredItems.map(
10085
10095
  (section, sectionIdx) => /* @__PURE__ */ jsxs14(SelectGroup, { children: [
10086
10096
  /* @__PURE__ */ jsx19(SelectLabel, { children: section.sectionLabel }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nurix/ui-component-library",
3
- "version": "1.1.4-stage.126",
3
+ "version": "1.1.4-stage.127",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",