@primer/behaviors 0.0.0-20231722480 → 0.0.0-202317231443

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.
@@ -198,8 +198,7 @@ function focusZone(container, settings) {
198
198
  element.setAttribute('tabindex', '-1');
199
199
  }
200
200
  if (!currentFocusedElement) {
201
- const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();
202
- updateFocusedElement(initialElement);
201
+ updateFocusedElement(getFirstFocusableElement());
203
202
  }
204
203
  }
205
204
  function findInsertionIndex(elementsToInsert) {
@@ -246,7 +245,8 @@ function focusZone(container, settings) {
246
245
  }
247
246
  }
248
247
  beginFocusManagement(...(0, iterate_focusable_elements_js_1.iterateFocusableElements)(container));
249
- updateFocusedElement(getFirstFocusableElement());
248
+ const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();
249
+ updateFocusedElement(initialElement);
250
250
  const observer = new MutationObserver(mutations => {
251
251
  for (const mutation of mutations) {
252
252
  for (const removedNode of mutation.removedNodes) {
@@ -195,8 +195,7 @@ export function focusZone(container, settings) {
195
195
  element.setAttribute('tabindex', '-1');
196
196
  }
197
197
  if (!currentFocusedElement) {
198
- const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();
199
- updateFocusedElement(initialElement);
198
+ updateFocusedElement(getFirstFocusableElement());
200
199
  }
201
200
  }
202
201
  function findInsertionIndex(elementsToInsert) {
@@ -243,7 +242,8 @@ export function focusZone(container, settings) {
243
242
  }
244
243
  }
245
244
  beginFocusManagement(...iterateFocusableElements(container));
246
- updateFocusedElement(getFirstFocusableElement());
245
+ const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();
246
+ updateFocusedElement(initialElement);
247
247
  const observer = new MutationObserver(mutations => {
248
248
  for (const mutation of mutations) {
249
249
  for (const removedNode of mutation.removedNodes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/behaviors",
3
- "version": "0.0.0-20231722480",
3
+ "version": "0.0.0-202317231443",
4
4
  "description": "Shared behaviors for JavaScript components",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",