Skip to content

Commit

Permalink
Fix counter display number incorrectly displayed on the page (#29448)
Browse files Browse the repository at this point in the history
issue : #28239

The counter number script uses the 'checkbox' attribute to determine
whether an item is selected or not.

However, the input event only increments the counter value, and when
more items are displayed, it does not update all previously loaded
items.

As a result, the display becomes incorrect because it triggers the
update counter script, but checkboxes that are selected without the
'checked' attribute are not counted
  • Loading branch information
charles7668 authored Feb 28, 2024
1 parent 10cfa08 commit 252047e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web_src/js/features/pull-view-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ export function initViewedCheckboxListenerFor() {
// Mark the file as viewed visually - will especially change the background
if (this.checked) {
form.classList.add(viewedStyleClass);
checkbox.setAttribute('checked', '');
prReview.numberOfViewedFiles++;
} else {
form.classList.remove(viewedStyleClass);
checkbox.removeAttribute('checked');
prReview.numberOfViewedFiles--;
}

Expand Down

0 comments on commit 252047e

Please sign in to comment.