@syncfusion/ej2-navigations 20.4.51 → 20.4.52

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.
@@ -2016,6 +2016,9 @@ let MenuBase = class MenuBase extends Component {
2016
2016
  return;
2017
2017
  }
2018
2018
  const iconLi = menu.querySelector('.e-menu-item:not(.e-blankicon):not(.e-separator)');
2019
+ if (!iconLi) {
2020
+ return;
2021
+ }
2019
2022
  const icon = iconLi.querySelector('.e-menu-icon');
2020
2023
  if (!icon) {
2021
2024
  return;
@@ -9812,7 +9815,6 @@ let TreeView = TreeView_1 = class TreeView extends Component {
9812
9815
  }
9813
9816
  initialize() {
9814
9817
  this.element.setAttribute('role', 'tree');
9815
- this.element.setAttribute('tabindex', '0');
9816
9818
  this.element.setAttribute('aria-activedescendant', this.element.id + '_active');
9817
9819
  this.setCssClass(null, this.cssClass);
9818
9820
  this.setEnableRtl();
@@ -10249,6 +10251,8 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10249
10251
  let fields = e.fields;
10250
10252
  this.addActionClass(e, fields.selected, SELECTED$1);
10251
10253
  this.addActionClass(e, fields.expanded, EXPANDED);
10254
+ e.item.setAttribute("tabindex", "-1");
10255
+ EventHandler.add(e.item, 'focus', this.focusIn, this);
10252
10256
  if (!isNullOrUndefined(this.nodeTemplateFn)) {
10253
10257
  let textEle = e.item.querySelector('.' + LISTTEXT);
10254
10258
  let dataId = e.item.getAttribute('data-uid');
@@ -10809,7 +10813,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
10809
10813
  this.setMultiSelect(this.allowMultiSelection);
10810
10814
  let firstNode = select('.' + LISTITEM, this.element);
10811
10815
  if (firstNode) {
10812
- addClass([firstNode], FOCUS);
10816
+ firstNode.setAttribute('tabindex', '0');
10813
10817
  this.updateIdAttr(null, firstNode);
10814
10818
  }
10815
10819
  if (this.allowTextWrap) {
@@ -11462,7 +11466,6 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11462
11466
  this.startNode = li;
11463
11467
  this.addSelect(li);
11464
11468
  }
11465
- this.setFocusElement(li);
11466
11469
  if (this.isLoaded) {
11467
11470
  eventArgs.nodeData = this.getNodeData(li);
11468
11471
  this.trigger('nodeSelected', eventArgs);
@@ -11496,8 +11499,11 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11496
11499
  let focusedNode = this.getFocusedNode();
11497
11500
  if (focusedNode) {
11498
11501
  removeClass([focusedNode], FOCUS);
11502
+ focusedNode.setAttribute("tabindex", "-1");
11499
11503
  }
11500
11504
  addClass([li], FOCUS);
11505
+ li.setAttribute('tabindex', '0');
11506
+ EventHandler.add(li, 'blur', this.focusOut, this);
11501
11507
  this.updateIdAttr(focusedNode, li);
11502
11508
  }
11503
11509
  }
@@ -11619,14 +11625,10 @@ let TreeView = TreeView_1 = class TreeView extends Component {
11619
11625
  let inpEle = target;
11620
11626
  if (e.action === 'enter') {
11621
11627
  inpEle.blur();
11622
- this.element.focus();
11623
- addClass([focusedNode], HOVER);
11624
11628
  }
11625
11629
  else if (e.action === 'escape') {
11626
11630
  inpEle.value = this.oldText;
11627
11631
  inpEle.blur();
11628
- this.element.focus();
11629
- addClass([focusedNode], HOVER);
11630
11632
  }
11631
11633
  return;
11632
11634
  }
@@ -12009,7 +12011,7 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12009
12011
  }
12010
12012
  getFocusedNode() {
12011
12013
  let selectedItem;
12012
- let fNode = select('.' + LISTITEM + '.' + FOCUS, this.element);
12014
+ let fNode = select('.' + LISTITEM + '[tabindex="0"]', this.element);
12013
12015
  if (isNullOrUndefined(fNode)) {
12014
12016
  selectedItem = select('.' + LISTITEM, this.element);
12015
12017
  }
@@ -12079,8 +12081,12 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12079
12081
  }
12080
12082
  setFocus(preNode, nextNode) {
12081
12083
  removeClass([preNode], [HOVER, FOCUS]);
12084
+ preNode.setAttribute("tabindex", "-1");
12082
12085
  if (!nextNode.classList.contains('e-disable') && !nextNode.classList.contains(PREVENTSELECT)) {
12083
12086
  addClass([nextNode], [HOVER, FOCUS]);
12087
+ nextNode.setAttribute('tabindex', '0');
12088
+ nextNode.focus();
12089
+ EventHandler.add(nextNode, 'blur', this.focusOut, this);
12084
12090
  this.updateIdAttr(preNode, nextNode);
12085
12091
  }
12086
12092
  }
@@ -12094,12 +12100,19 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12094
12100
  }
12095
12101
  focusIn() {
12096
12102
  if (!this.mouseDownStatus) {
12097
- addClass([this.getFocusedNode()], HOVER);
12103
+ let focusedElement = this.getFocusedNode();
12104
+ focusedElement.setAttribute("tanindex", "0");
12105
+ addClass([focusedElement], [HOVER, FOCUS]);
12106
+ EventHandler.add(focusedElement, 'blur', this.focusOut, this);
12098
12107
  }
12099
12108
  this.mouseDownStatus = false;
12100
12109
  }
12101
- focusOut() {
12102
- removeClass([this.getFocusedNode()], HOVER);
12110
+ focusOut(event) {
12111
+ let focusedElement = this.getFocusedNode();
12112
+ if (event.target == focusedElement) {
12113
+ removeClass([focusedElement], [HOVER, FOCUS]);
12114
+ EventHandler.remove(focusedElement, 'blur', this.focusOut);
12115
+ }
12103
12116
  }
12104
12117
  onMouseOver(e) {
12105
12118
  let target = e.target;
@@ -12305,7 +12318,9 @@ let TreeView = TreeView_1 = class TreeView extends Component {
12305
12318
  }
12306
12319
  if (isInput) {
12307
12320
  removeClass([liEle], EDITING);
12308
- txtEle.focus();
12321
+ liEle.focus();
12322
+ EventHandler.add(liEle, 'blur', this.focusOut, this);
12323
+ addClass([liEle], HOVER);
12309
12324
  }
12310
12325
  if (this.allowTextWrap) {
12311
12326
  this.calculateWrap(liEle);
@@ -13568,8 +13583,6 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13568
13583
  if (this.expandOnType !== 'None') {
13569
13584
  this.wireExpandOnEvent(true);
13570
13585
  }
13571
- EventHandler.add(this.element, 'focus', this.focusIn, this);
13572
- EventHandler.add(this.element, 'blur', this.focusOut, this);
13573
13586
  EventHandler.add(this.element, 'mouseover', this.onMouseOver, this);
13574
13587
  EventHandler.add(this.element, 'mouseout', this.onMouseLeave, this);
13575
13588
  this.keyboardModule = new KeyboardEvents(this.element, {
@@ -13582,8 +13595,6 @@ let TreeView = TreeView_1 = class TreeView extends Component {
13582
13595
  EventHandler.remove(this.element, 'mousedown', this.mouseDownHandler);
13583
13596
  this.wireClickEvent(false);
13584
13597
  this.wireExpandOnEvent(false);
13585
- EventHandler.remove(this.element, 'focus', this.focusIn);
13586
- EventHandler.remove(this.element, 'blur', this.focusOut);
13587
13598
  EventHandler.remove(this.element, 'mouseover', this.onMouseOver);
13588
13599
  EventHandler.remove(this.element, 'mouseout', this.onMouseLeave);
13589
13600
  if (!this.disabled) {
@@ -14070,7 +14081,6 @@ let TreeView = TreeView_1 = class TreeView extends Component {
14070
14081
  destroy() {
14071
14082
  this.clearTemplate();
14072
14083
  this.element.removeAttribute('aria-activedescendant');
14073
- this.element.removeAttribute('tabindex');
14074
14084
  this.unWireEvents();
14075
14085
  this.wireEditingEvents(false);
14076
14086
  if (!this.disabled) {
@@ -15374,6 +15384,7 @@ let Breadcrumb = class Breadcrumb extends Component {
15374
15384
  */
15375
15385
  constructor(options, element) {
15376
15386
  super(options, element);
15387
+ this.isPopupCreated = false;
15377
15388
  }
15378
15389
  /**
15379
15390
  * @private
@@ -15812,13 +15823,14 @@ let Breadcrumb = class Breadcrumb extends Component {
15812
15823
  this.isExpanded = true;
15813
15824
  this.reRenderItems();
15814
15825
  }
15815
- if (e.target.classList.contains(MENUCLASS)) {
15826
+ if (e.target.classList.contains(MENUCLASS) && !this.isPopupCreated) {
15816
15827
  this.renderPopup();
15817
15828
  }
15818
15829
  }
15819
15830
  renderPopup() {
15820
15831
  const wrapper = this.createElement('div', { className: POPUPCLASS + ' ' + this.cssClass + (this.enableRtl ? ' e-rtl' : '') });
15821
15832
  document.body.appendChild(wrapper);
15833
+ this.isPopupCreated = true;
15822
15834
  this.popupObj = new Popup(wrapper, {
15823
15835
  content: this.popupUl,
15824
15836
  relateTo: this.element.querySelector(DOT + MENUCLASS),
@@ -15836,6 +15848,7 @@ let Breadcrumb = class Breadcrumb extends Component {
15836
15848
  if (this.overflowMode === 'Menu' && this.popupObj && this.popupObj.element.classList.contains('e-popup-open') && !closest(e.target, DOT + MENUCLASS)) {
15837
15849
  this.popupObj.hide();
15838
15850
  this.popupObj.destroy();
15851
+ this.isPopupCreated = false;
15839
15852
  detach(this.popupObj.element);
15840
15853
  }
15841
15854
  }