@primer/behaviors 0.0.0-20241018180654 → 0.0.0-20241107161818
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/cjs/focus-trap.js
CHANGED
|
@@ -62,8 +62,11 @@ function focusTrap(container, initialFocus, abortSignal) {
|
|
|
62
62
|
const firstFocusableChild = iterateFocusableElements.getFocusableChild(container);
|
|
63
63
|
firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();
|
|
64
64
|
};
|
|
65
|
-
container.
|
|
66
|
-
|
|
65
|
+
const existingSentinels = Array.from(container.children).filter(e => e.classList.contains('sentinel'));
|
|
66
|
+
if (!existingSentinels.length) {
|
|
67
|
+
container.prepend(sentinelStart);
|
|
68
|
+
container.append(sentinelEnd);
|
|
69
|
+
}
|
|
67
70
|
const observer = observeFocusTrap(container, [sentinelStart, sentinelEnd]);
|
|
68
71
|
let lastFocusedChild = undefined;
|
|
69
72
|
function ensureTrapZoneHasFocus(focusedElement) {
|
package/dist/cjs/focus-zone.js
CHANGED
|
@@ -182,6 +182,7 @@ function focusZone(container, settings) {
|
|
|
182
182
|
}
|
|
183
183
|
activeDescendantControl === null || activeDescendantControl === void 0 ? void 0 : activeDescendantControl.removeAttribute('aria-activedescendant');
|
|
184
184
|
container.removeAttribute(hasActiveDescendantAttribute);
|
|
185
|
+
previouslyActiveElement === null || previouslyActiveElement === void 0 ? void 0 : previouslyActiveElement.removeAttribute(isActiveDescendantAttribute);
|
|
185
186
|
for (const item of container.querySelectorAll(`[${isActiveDescendantAttribute}]`)) {
|
|
186
187
|
item === null || item === void 0 ? void 0 : item.removeAttribute(isActiveDescendantAttribute);
|
|
187
188
|
}
|
package/dist/esm/focus-trap.mjs
CHANGED
|
@@ -60,8 +60,11 @@ function focusTrap(container, initialFocus, abortSignal) {
|
|
|
60
60
|
const firstFocusableChild = getFocusableChild(container);
|
|
61
61
|
firstFocusableChild === null || firstFocusableChild === void 0 ? void 0 : firstFocusableChild.focus();
|
|
62
62
|
};
|
|
63
|
-
container.
|
|
64
|
-
|
|
63
|
+
const existingSentinels = Array.from(container.children).filter(e => e.classList.contains('sentinel'));
|
|
64
|
+
if (!existingSentinels.length) {
|
|
65
|
+
container.prepend(sentinelStart);
|
|
66
|
+
container.append(sentinelEnd);
|
|
67
|
+
}
|
|
65
68
|
const observer = observeFocusTrap(container, [sentinelStart, sentinelEnd]);
|
|
66
69
|
let lastFocusedChild = undefined;
|
|
67
70
|
function ensureTrapZoneHasFocus(focusedElement) {
|
package/dist/esm/focus-zone.mjs
CHANGED
|
@@ -180,6 +180,7 @@ function focusZone(container, settings) {
|
|
|
180
180
|
}
|
|
181
181
|
activeDescendantControl === null || activeDescendantControl === void 0 ? void 0 : activeDescendantControl.removeAttribute('aria-activedescendant');
|
|
182
182
|
container.removeAttribute(hasActiveDescendantAttribute);
|
|
183
|
+
previouslyActiveElement === null || previouslyActiveElement === void 0 ? void 0 : previouslyActiveElement.removeAttribute(isActiveDescendantAttribute);
|
|
183
184
|
for (const item of container.querySelectorAll(`[${isActiveDescendantAttribute}]`)) {
|
|
184
185
|
item === null || item === void 0 ? void 0 : item.removeAttribute(isActiveDescendantAttribute);
|
|
185
186
|
}
|