Skip to content

Commit

Permalink
Fix: Exclude hidden items from items count ARIA
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-allen-89 committed Oct 19, 2023
1 parent 0ac6fe6 commit b848c9d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/BoxMenuView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) ?
Expand Down

0 comments on commit b848c9d

Please sign in to comment.