@syncfusion/ej2-splitbuttons 20.4.38 → 20.4.40

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.
@@ -304,8 +304,7 @@ let DropDownButton = class DropDownButton extends Component {
304
304
  this.dropDown.hide();
305
305
  attributes(this.element, {
306
306
  ['aria-haspopup']: this.items.length || this.target ? 'true' : 'false', ['aria-expanded']: 'false',
307
- ['aria-owns']: this.getPopUpElement().id, ['type']: 'button',
308
- ['aria-label']: this.element.textContent ? this.element.textContent : 'dropdownbutton'
307
+ ['type']: 'button', ['aria-label']: this.element.textContent ? this.element.textContent : 'dropdownbutton'
309
308
  });
310
309
  if (this.cssClass) {
311
310
  addClass([div], this.cssClass.split(' '));
@@ -694,6 +693,7 @@ let DropDownButton = class DropDownButton extends Component {
694
693
  this.dropDown.show(null, this.element);
695
694
  addClass([this.element], 'e-active');
696
695
  this.element.setAttribute('aria-expanded', 'true');
696
+ this.element.setAttribute('aria-owns', this.getPopUpElement().id);
697
697
  if (ul) {
698
698
  ul.focus();
699
699
  }
@@ -705,12 +705,12 @@ let DropDownButton = class DropDownButton extends Component {
705
705
  closePopup(e = null, focusEle) {
706
706
  const ul = this.getULElement();
707
707
  const beforeCloseArgs = { element: ul, items: this.items, event: e, cancel: false };
708
- const popupElement = this.getPopUpElement();
709
- if (popupElement) {
710
- EventHandler.remove(popupElement, 'keydown', this.keyBoardHandler);
711
- }
712
708
  this.trigger('beforeClose', beforeCloseArgs, (observedArgs) => {
713
709
  if (!observedArgs.cancel) {
710
+ const popupElement = this.getPopUpElement();
711
+ if (popupElement) {
712
+ EventHandler.remove(popupElement, 'keydown', this.keyBoardHandler);
713
+ }
714
714
  this.popupUnWireEvents();
715
715
  const ul = this.getULElement();
716
716
  let selectedLi;
@@ -723,6 +723,7 @@ let DropDownButton = class DropDownButton extends Component {
723
723
  this.dropDown.hide();
724
724
  removeClass(this.activeElem, 'e-active');
725
725
  this.element.setAttribute('aria-expanded', 'false');
726
+ this.element.removeAttribute('aria-owns');
726
727
  if (focusEle) {
727
728
  focusEle.focus();
728
729
  }
@@ -740,6 +741,11 @@ let DropDownButton = class DropDownButton extends Component {
740
741
  this.isPopupCreated = this.createPopupOnClick ? false : true;
741
742
  }
742
743
  }
744
+ else {
745
+ if (ul) {
746
+ ul.focus();
747
+ }
748
+ }
743
749
  });
744
750
  }
745
751
  unWireEvents() {