@versini/ui-hooks 5.3.0 → 5.3.1

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  /*!
2
- @versini/ui-hooks v5.3.0
2
+ @versini/ui-hooks v5.3.1
3
3
  © 2025 gizmette.com
4
4
  */
5
5
  try {
6
6
  if (!window.__VERSINI_UI_HOOKS__) {
7
7
  window.__VERSINI_UI_HOOKS__ = {
8
- version: "5.3.0",
9
- buildTime: "12/14/2025 08:04 PM EST",
8
+ version: "5.3.1",
9
+ buildTime: "12/15/2025 06:38 PM EST",
10
10
  homepage: "https://www.npmjs.com/package/@versini/ui-hooks",
11
11
  license: "MIT",
12
12
  };
@@ -129,8 +129,8 @@ const DEFAULT_EVENTS = [
129
129
  return;
130
130
  }
131
131
  const activeElement = document.activeElement;
132
- // If focus is in a nested dialog, let that dialog handle Tab.
133
- if (activeElement && !containerRef.current.contains(activeElement) && activeElement.closest('[role="dialog"]')) {
132
+ // If focus is in a nested dialog or menu, let that element handle Tab.
133
+ if (activeElement && !containerRef.current.contains(activeElement) && activeElement.closest('[role="dialog"], [role="menu"]')) {
134
134
  return;
135
135
  }
136
136
  const focusableElements = getFocusableElements();
@@ -171,9 +171,9 @@ const DEFAULT_EVENTS = [
171
171
  if (!containerRef.current || containerRef.current.contains(event.target)) {
172
172
  return;
173
173
  }
174
- // Allow focus to go to nested dialogs (child panels).
174
+ // Allow focus to go to nested dialogs (child panels) or menus (dropdown menus).
175
175
  const target = event.target;
176
- if (target?.closest('[role="dialog"]')) {
176
+ if (target?.closest('[role="dialog"], [role="menu"]')) {
177
177
  return;
178
178
  }
179
179
  // Focus escaped the container, bring it back.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versini/ui-hooks",
3
- "version": "5.3.0",
3
+ "version": "5.3.1",
4
4
  "license": "MIT",
5
5
  "author": "Arno Versini",
6
6
  "publishConfig": {
@@ -36,5 +36,5 @@
36
36
  "test:watch": "vitest",
37
37
  "test": "vitest run"
38
38
  },
39
- "gitHead": "15f3028acf21328c70773147a6bedfbafaa3a2a4"
39
+ "gitHead": "e525a00f1bf7288dffb5c49451e075cedc22aaa0"
40
40
  }