From b848c9dd8368d8415908d52aa40c1ab271c59e8d Mon Sep 17 00:00:00 2001 From: joe-allen-89 <85872286+joe-allen-89@users.noreply.github.com> Date: Thu, 19 Oct 2023 10:21:48 +0100 Subject: [PATCH] Fix: Exclude hidden items from items count ARIA --- js/BoxMenuView.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/BoxMenuView.js b/js/BoxMenuView.js index 6692c9c..25a2f7d 100644 --- a/js/BoxMenuView.js +++ b/js/BoxMenuView.js @@ -23,6 +23,11 @@ class BoxMenuView extends MenuView { addChildren() { let nthChild = 0; const models = this.model.getChildren().models; + const totalChild = this.model.getChildren().where({ + _isAvailable: true, + _isHidden: false + }).length; + const childViews = []; models.forEach(model => { if (!model.get('_isAvailable')) return; @@ -35,7 +40,7 @@ class BoxMenuView extends MenuView { nthChild++; model.set({ _nthChild: nthChild, - _totalChild: models.length + _totalChild: totalChild }); const ChildView = (model.get('_type') === 'menu' && model.get('_boxMenu') && model.get('_boxMenu')._renderAsGroup) ?