@aemforms/af-core 0.22.134 → 0.22.135

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.
@@ -3638,22 +3638,24 @@ class Form extends Container {
3638
3638
  return children.filter(child => child.visible === true);
3639
3639
  }
3640
3640
  #getFirstNavigableChild(container) {
3641
- const navigableChidren = this.#getNavigableChildren(container.items);
3642
- if (navigableChidren) {
3643
- return navigableChidren[0];
3641
+ const navigableChildren = this.#getNavigableChildren(container.items);
3642
+ if (navigableChildren && navigableChildren.length > 0) {
3643
+ return navigableChildren[0];
3644
3644
  }
3645
3645
  return null;
3646
3646
  }
3647
3647
  #setActiveFirstDeepChild(currentField) {
3648
3648
  if (!currentField.isContainer) {
3649
- const parent = currentField.parent;
3650
- parent.activeChild = currentField;
3649
+ currentField.parent.activeChild = currentField;
3651
3650
  return;
3652
3651
  }
3653
3652
  this.#clearCurrentFocus(currentField);
3654
- let currentActiveChild = currentField.activeChild;
3655
- currentActiveChild = (currentActiveChild === null) ? this.#getFirstNavigableChild(currentField) : currentField.activeChild;
3656
- this.#setActiveFirstDeepChild(currentActiveChild);
3653
+ const activeChild = currentField.activeChild || this.#getFirstNavigableChild(currentField);
3654
+ if (activeChild === null) {
3655
+ currentField.parent.activeChild = currentField;
3656
+ return;
3657
+ }
3658
+ this.#setActiveFirstDeepChild(activeChild);
3657
3659
  }
3658
3660
  #getNextItem(currIndex, navigableChidren) {
3659
3661
  if (currIndex < (navigableChidren.length - 1)) {
package/lib/Form.js CHANGED
@@ -401,21 +401,23 @@ class Form extends Container_1.default {
401
401
  _Form_instances = new WeakSet(), _Form_getNavigableChildren = function _Form_getNavigableChildren(children) {
402
402
  return children.filter(child => child.visible === true);
403
403
  }, _Form_getFirstNavigableChild = function _Form_getFirstNavigableChild(container) {
404
- const navigableChidren = __classPrivateFieldGet(this, _Form_instances, "m", _Form_getNavigableChildren).call(this, container.items);
405
- if (navigableChidren) {
406
- return navigableChidren[0];
404
+ const navigableChildren = __classPrivateFieldGet(this, _Form_instances, "m", _Form_getNavigableChildren).call(this, container.items);
405
+ if (navigableChildren && navigableChildren.length > 0) {
406
+ return navigableChildren[0];
407
407
  }
408
408
  return null;
409
409
  }, _Form_setActiveFirstDeepChild = function _Form_setActiveFirstDeepChild(currentField) {
410
410
  if (!currentField.isContainer) {
411
- const parent = currentField.parent;
412
- parent.activeChild = currentField;
411
+ currentField.parent.activeChild = currentField;
413
412
  return;
414
413
  }
415
414
  __classPrivateFieldGet(this, _Form_instances, "m", _Form_clearCurrentFocus).call(this, currentField);
416
- let currentActiveChild = currentField.activeChild;
417
- currentActiveChild = (currentActiveChild === null) ? __classPrivateFieldGet(this, _Form_instances, "m", _Form_getFirstNavigableChild).call(this, currentField) : currentField.activeChild;
418
- __classPrivateFieldGet(this, _Form_instances, "m", _Form_setActiveFirstDeepChild).call(this, currentActiveChild);
415
+ const activeChild = currentField.activeChild || __classPrivateFieldGet(this, _Form_instances, "m", _Form_getFirstNavigableChild).call(this, currentField);
416
+ if (activeChild === null) {
417
+ currentField.parent.activeChild = currentField;
418
+ return;
419
+ }
420
+ __classPrivateFieldGet(this, _Form_instances, "m", _Form_setActiveFirstDeepChild).call(this, activeChild);
419
421
  }, _Form_getNextItem = function _Form_getNextItem(currIndex, navigableChidren) {
420
422
  if (currIndex < (navigableChidren.length - 1)) {
421
423
  return navigableChidren[currIndex + 1];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aemforms/af-core",
3
- "version": "0.22.134",
3
+ "version": "0.22.135",
4
4
  "description": "Core Module for Forms Runtime",
5
5
  "author": "Adobe Systems",
6
6
  "license": "Adobe Proprietary",
@@ -37,7 +37,7 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@adobe/json-formula": "0.1.50",
40
- "@aemforms/af-formatters": "^0.22.134"
40
+ "@aemforms/af-formatters": "^0.22.135"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@babel/preset-env": "^7.20.2",