Skip to content

Commit

Permalink
Fix: Update item count ARIA for grouped items (fixes #160) (#162)
Browse files Browse the repository at this point in the history
* Update item count for grouped items

* remove _nthChild from updated item count

* set models.length to a variable

Co-authored-by: Brad Simpson <brad.simpson@kineo.com>

* Update js/BoxMenuGroupView.js

---------

Co-authored-by: Brad Simpson <brad.simpson@kineo.com>
Co-authored-by: Oliver Foster <oliver.foster@kineo.com>
  • Loading branch information
3 people authored Sep 13, 2023
1 parent 1139ecb commit f3ea395
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/BoxMenuGroupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ class BoxMenuGroupView extends MenuItemView {
_.defer(this.addChildren.bind(this));
this.$el.imageready(this.setReadyStatus.bind(this));
this.$el.parents('.boxmenu__item-container').addClass('has-groups');
this.updateItemCount();
}

updateItemCount() {
const models = this.model.getChildren().models;
const totalChildren = models.length;
models.forEach(model => model.set('_totalChild', totalChildren));
}
}

Expand Down

0 comments on commit f3ea395

Please sign in to comment.