@primer/behaviors 0.0.0-20251215032051 → 0.0.0-20251215033828

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.
@@ -48,8 +48,8 @@ function focusTrap(container, initialFocus, abortSignal) {
48
48
  const signal = abortSignal !== null && abortSignal !== void 0 ? abortSignal : controller.signal;
49
49
  container.setAttribute('data-focus-trap', 'active');
50
50
  const sentinelStart = document.createElement('span');
51
- sentinelStart.className = 'sentinel';
52
- sentinelStart.tabIndex = 0;
51
+ sentinelStart.setAttribute('class', 'sentinel');
52
+ sentinelStart.setAttribute('tabindex', '0');
53
53
  sentinelStart.setAttribute('aria-hidden', 'true');
54
54
  sentinelStart.style.cssText =
55
55
  'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0';
@@ -58,8 +58,8 @@ function focusTrap(container, initialFocus, abortSignal) {
58
58
  lastFocusableChild === null || lastFocusableChild === void 0 ? void 0 : lastFocusableChild.focus();
59
59
  };
60
60
  const sentinelEnd = document.createElement('span');
61
- sentinelEnd.className = 'sentinel';
62
- sentinelEnd.tabIndex = 0;
61
+ sentinelEnd.setAttribute('class', 'sentinel');
62
+ sentinelEnd.setAttribute('tabindex', '0');
63
63
  sentinelEnd.setAttribute('aria-hidden', 'true');
64
64
  sentinelEnd.style.cssText =
65
65
  'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0';
@@ -338,6 +338,7 @@ function focusZone(container, settings) {
338
338
  signal.addEventListener('abort', () => {
339
339
  observer.disconnect();
340
340
  endFocusManagement(...focusableElements);
341
+ focusableElements.clear();
341
342
  });
342
343
  let elementIndexFocusedByClick = undefined;
343
344
  container.addEventListener('mousedown', event => {
@@ -46,8 +46,8 @@ function focusTrap(container, initialFocus, abortSignal) {
46
46
  const signal = abortSignal !== null && abortSignal !== void 0 ? abortSignal : controller.signal;
47
47
  container.setAttribute('data-focus-trap', 'active');
48
48
  const sentinelStart = document.createElement('span');
49
- sentinelStart.className = 'sentinel';
50
- sentinelStart.tabIndex = 0;
49
+ sentinelStart.setAttribute('class', 'sentinel');
50
+ sentinelStart.setAttribute('tabindex', '0');
51
51
  sentinelStart.setAttribute('aria-hidden', 'true');
52
52
  sentinelStart.style.cssText =
53
53
  'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0';
@@ -56,8 +56,8 @@ function focusTrap(container, initialFocus, abortSignal) {
56
56
  lastFocusableChild === null || lastFocusableChild === void 0 ? void 0 : lastFocusableChild.focus();
57
57
  };
58
58
  const sentinelEnd = document.createElement('span');
59
- sentinelEnd.className = 'sentinel';
60
- sentinelEnd.tabIndex = 0;
59
+ sentinelEnd.setAttribute('class', 'sentinel');
60
+ sentinelEnd.setAttribute('tabindex', '0');
61
61
  sentinelEnd.setAttribute('aria-hidden', 'true');
62
62
  sentinelEnd.style.cssText =
63
63
  'position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0';
@@ -336,6 +336,7 @@ function focusZone(container, settings) {
336
336
  signal.addEventListener('abort', () => {
337
337
  observer.disconnect();
338
338
  endFocusManagement(...focusableElements);
339
+ focusableElements.clear();
339
340
  });
340
341
  let elementIndexFocusedByClick = undefined;
341
342
  container.addEventListener('mousedown', event => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/behaviors",
3
- "version": "0.0.0-20251215032051",
3
+ "version": "0.0.0-20251215033828",
4
4
  "description": "Shared behaviors for JavaScript components",
5
5
  "type": "commonjs",
6
6
  "main": "dist/cjs/index.js",