@syncfusion/ej2-navigations 21.2.8 → 21.2.9

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.
@@ -1458,7 +1458,14 @@ let MenuBase = class MenuBase extends Component {
1458
1458
  }
1459
1459
  getUlByNavIdx(navIdxLen = this.navIdx.length) {
1460
1460
  if (this.isMenu) {
1461
- const popup = [this.getWrapper()].concat([].slice.call(selectAll('.' + POPUP)))[navIdxLen];
1461
+ const popups = [];
1462
+ const allPopup = selectAll('.' + POPUP);
1463
+ allPopup.forEach((elem) => {
1464
+ if (this.element.id === elem.id.split('-')[2]) {
1465
+ popups.push(elem);
1466
+ }
1467
+ });
1468
+ const popup = [this.getWrapper()].concat([].slice.call(popups))[navIdxLen];
1462
1469
  return isNullOrUndefined(popup) ? null : select('.e-menu-parent', popup);
1463
1470
  }
1464
1471
  else {
@@ -3633,20 +3640,20 @@ let Toolbar = class Toolbar extends Component {
3633
3640
  if (isVisible(this.popObj.element)) {
3634
3641
  nodes = [].slice.call(popupCheck.children);
3635
3642
  if (e.action === 'home') {
3636
- ele = nodes[0];
3643
+ ele = this.focusFirstVisibleEle(nodes);
3637
3644
  }
3638
3645
  else {
3639
- ele = nodes[nodes.length - 1];
3646
+ ele = this.focusLastVisibleEle(nodes);
3640
3647
  }
3641
3648
  }
3642
3649
  }
3643
3650
  else {
3644
3651
  nodes = this.element.querySelectorAll('.' + CLS_ITEMS + ' .' + CLS_ITEM + ':not(.' + CLS_SEPARATOR + ')');
3645
3652
  if (e.action === 'home') {
3646
- ele = nodes[0];
3653
+ ele = this.focusFirstVisibleEle(nodes);
3647
3654
  }
3648
3655
  else {
3649
- ele = nodes[nodes.length - 1];
3656
+ ele = this.focusLastVisibleEle(nodes);
3650
3657
  }
3651
3658
  }
3652
3659
  if (ele) {
@@ -3760,6 +3767,30 @@ let Toolbar = class Toolbar extends Component {
3760
3767
  eleContains(el) {
3761
3768
  return el.classList.contains(CLS_SEPARATOR) || el.classList.contains(CLS_DISABLE$2) || el.getAttribute('disabled') || el.classList.contains(CLS_HIDDEN) || !isVisible(el) || !el.classList.contains(CLS_ITEM);
3762
3769
  }
3770
+ focusFirstVisibleEle(nodes) {
3771
+ let element;
3772
+ let index = 0;
3773
+ while (index < nodes.length) {
3774
+ const ele = nodes[parseInt(index.toString(), 10)];
3775
+ if (!ele.classList.contains(CLS_HIDDEN) && !ele.classList.contains(CLS_DISABLE$2)) {
3776
+ return ele;
3777
+ }
3778
+ index++;
3779
+ }
3780
+ return element;
3781
+ }
3782
+ focusLastVisibleEle(nodes) {
3783
+ let element;
3784
+ let index = nodes.length - 1;
3785
+ while (index >= 0) {
3786
+ const ele = nodes[parseInt(index.toString(), 10)];
3787
+ if (!ele.classList.contains(CLS_HIDDEN) && !ele.classList.contains(CLS_DISABLE$2)) {
3788
+ return ele;
3789
+ }
3790
+ index--;
3791
+ }
3792
+ return element;
3793
+ }
3763
3794
  eleFocus(closest$$1, pos) {
3764
3795
  const sib = Object(closest$$1)[pos + 'ElementSibling'];
3765
3796
  if (sib) {
@@ -4401,12 +4432,10 @@ let Toolbar = class Toolbar extends Component {
4401
4432
  if (checkoffset) {
4402
4433
  if (inEle[parseInt(i.toString(), 10)].classList.contains(CLS_SEPARATOR)) {
4403
4434
  if (this.overflowMode === 'Extended') {
4404
- if (itemCount === itemPopCount) {
4405
- const sepEle = inEle[parseInt(i.toString(), 10)];
4406
- if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
4407
- inEle[parseInt(i.toString(), 10)].classList.add(CLS_POPUP);
4408
- itemPopCount++;
4409
- }
4435
+ const sepEle = inEle[parseInt(i.toString(), 10)];
4436
+ if (checkClass(sepEle, [CLS_SEPARATOR, CLS_TBARIGNORE])) {
4437
+ inEle[parseInt(i.toString(), 10)].classList.add(CLS_POPUP);
4438
+ itemPopCount++;
4410
4439
  }
4411
4440
  itemCount++;
4412
4441
  }
@@ -5357,10 +5386,7 @@ let Toolbar = class Toolbar extends Component {
5357
5386
  break;
5358
5387
  case 'width':
5359
5388
  setStyleAttribute(tEle, { 'width': formatUnit(newProp.width) });
5360
- this.renderOverflowMode();
5361
- if (this.popObj && wid < tEle.offsetWidth) {
5362
- this.popupRefresh(this.popObj.element, false);
5363
- }
5389
+ this.refreshOverflow();
5364
5390
  break;
5365
5391
  case 'height':
5366
5392
  setStyleAttribute(this.element, { 'height': formatUnit(newProp.height) });