@primer/behaviors 0.0.0-20240814153017 → 0.0.0-20240821162245
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
|
@@ -26,6 +26,10 @@ function observeFocusTrap(container, sentinels) {
|
|
|
26
26
|
for (const mutation of mutations) {
|
|
27
27
|
console.log('Mutations:', mutations);
|
|
28
28
|
if (mutation.type === 'childList' && mutation.addedNodes.length) {
|
|
29
|
+
const sentinelChildren = Array.from(mutation.addedNodes, e => e instanceof HTMLElement && e.classList.contains('sentinel') && e.tagName === 'SPAN');
|
|
30
|
+
if (sentinelChildren.length) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
29
33
|
console.log('ChildList Mutation');
|
|
30
34
|
const firstChild = container.firstElementChild;
|
|
31
35
|
const lastChild = container.lastElementChild;
|
package/dist/esm/focus-trap.mjs
CHANGED
|
@@ -24,6 +24,10 @@ function observeFocusTrap(container, sentinels) {
|
|
|
24
24
|
for (const mutation of mutations) {
|
|
25
25
|
console.log('Mutations:', mutations);
|
|
26
26
|
if (mutation.type === 'childList' && mutation.addedNodes.length) {
|
|
27
|
+
const sentinelChildren = Array.from(mutation.addedNodes, e => e instanceof HTMLElement && e.classList.contains('sentinel') && e.tagName === 'SPAN');
|
|
28
|
+
if (sentinelChildren.length) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
27
31
|
console.log('ChildList Mutation');
|
|
28
32
|
const firstChild = container.firstElementChild;
|
|
29
33
|
const lastChild = container.lastElementChild;
|