@syncfusion/ej2-ribbon 24.1.41 → 24.1.44

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.
@@ -125,10 +125,7 @@ var RibbonGroupButton = /** @class */ (function () {
125
125
  this.addGroupButtonHeader(item.id, groupBtnSettings, dropDownPopup.element);
126
126
  }
127
127
  buttonEle.onclick = buttonEle.onkeydown = function () {
128
- if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
129
- document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + 0).focus();
130
- _this.grpBtnIndex = 0;
131
- }
128
+ _this.handleFocusState(item, itemElement);
132
129
  };
133
130
  btnContainerEle.onkeydown = function (e) {
134
131
  if (_this.parent.activeLayout === 'Simplified') {
@@ -299,10 +296,7 @@ var RibbonGroupButton = /** @class */ (function () {
299
296
  this.addGroupButtonHeader(item.id, groupBtnSettings, dropDownPopup.element);
300
297
  }
301
298
  buttonEle.onclick = buttonEle.onkeydown = function () {
302
- if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
303
- document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + 0).focus();
304
- _this.grpBtnIndex = 0;
305
- }
299
+ _this.handleFocusState(item, itemElement);
306
300
  };
307
301
  containerEle.onkeydown = function (e) {
308
302
  if (_this.parent.activeLayout === 'Simplified') {
@@ -321,6 +315,18 @@ var RibbonGroupButton = /** @class */ (function () {
321
315
  }
322
316
  }
323
317
  };
318
+ RibbonGroupButton.prototype.handleFocusState = function (item, itemElement) {
319
+ if (itemElement.querySelector('#' + item.id).classList.contains('e-active')) {
320
+ var defaultSelectedBtn = document.querySelector('#' + item.id + '_grpbtn').querySelector('.' + constants.RIBBON_GROUP_BUTTON + '.e-active');
321
+ if (defaultSelectedBtn) {
322
+ defaultSelectedBtn.focus();
323
+ }
324
+ else {
325
+ document.querySelector('#' + item.id + constants.RIBBON_GROUP_BUTTON_ID + 0).focus();
326
+ }
327
+ this.grpBtnIndex = 0;
328
+ }
329
+ };
324
330
  RibbonGroupButton.prototype.addGroupButtonHeader = function (itemID, groupBtnSettings, popupEle) {
325
331
  var groupButtonHeader = this.parent.createElement('div', {
326
332
  className: 'e-ribbon-groupbutton-header',