diff --git a/asset/js/widget/ActionList.js b/asset/js/widget/ActionList.js index f174d0d5..4af72272 100644 --- a/asset/js/widget/ActionList.js +++ b/asset/js/widget/ActionList.js @@ -56,6 +56,15 @@ define(["../notjQuery"], function (notjQuery) { return queryString.split('|'); } + /** + * Remove the `[ ]`brackets from the given identifier + * @param identifier + * @return {*} + */ + removeBrackets(identifier) { + return identifier.replaceAll(/[\[\]]/g, ''); + } + /** * Suspend auto refresh for the given item's container * @@ -332,11 +341,16 @@ define(["../notjQuery"], function (notjQuery) { _this.handleLoadMoreNavigate(toActiveItem, lastActivatedItem, event.key); return; } + } + + while (toActiveItem) { + if (toActiveItem.hasAttribute(this.removeBrackets(this.listItemIdentifier))) { + _this.clearSelection(activeItems); - _this.clearSelection(activeItems); - if (toActiveItem.classList.contains('page-separator')) { - toActiveItem = _this.getDirectionalNext(toActiveItem, event.key); + break; } + + toActiveItem = _this.getDirectionalNext(toActiveItem, event.key); } } @@ -565,7 +579,7 @@ define(["../notjQuery"], function (notjQuery) { // list has now new items, so select the lastActivatedItem and then move forward let toActiveItem = lastActivatedItem.nextElementSibling; while (toActiveItem) { - if (toActiveItem.hasAttribute(this.listItemIdentifier.replaceAll(/[\[\]]/g, ''))) { + if (toActiveItem.hasAttribute(this.removeBrackets(this.listItemIdentifier))) { this.clearSelection([lastActivatedItem]); this.setActive(toActiveItem); this.setLastActivatedItemUrl(toActiveItem.dataset.icingaDetailFilter);