@primer/behaviors 1.3.2 → 1.3.3

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.
@@ -245,7 +245,8 @@ function focusZone(container, settings) {
245
245
  }
246
246
  }
247
247
  beginFocusManagement(...(0, iterate_focusable_elements_js_1.iterateFocusableElements)(container));
248
- updateFocusedElement(getFirstFocusableElement());
248
+ const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();
249
+ updateFocusedElement(initialElement);
249
250
  const observer = new MutationObserver(mutations => {
250
251
  for (const mutation of mutations) {
251
252
  for (const removedNode of mutation.removedNodes) {
@@ -242,7 +242,8 @@ export function focusZone(container, settings) {
242
242
  }
243
243
  }
244
244
  beginFocusManagement(...iterateFocusableElements(container));
245
- updateFocusedElement(getFirstFocusableElement());
245
+ const initialElement = typeof focusInStrategy === 'function' ? focusInStrategy(document.body) : getFirstFocusableElement();
246
+ updateFocusedElement(initialElement);
246
247
  const observer = new MutationObserver(mutations => {
247
248
  for (const mutation of mutations) {
248
249
  for (const removedNode of mutation.removedNodes) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/behaviors",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Shared behaviors for JavaScript components",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",