Skip to content

Commit 252047e

Browse files
authored
Fix counter display number incorrectly displayed on the page (#29448)
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
1 parent 10cfa08 commit 252047e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

web_src/js/features/pull-view-file.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ export function initViewedCheckboxListenerFor() {
4343
// Mark the file as viewed visually - will especially change the background
4444
if (this.checked) {
4545
form.classList.add(viewedStyleClass);
46+
checkbox.setAttribute('checked', '');
4647
prReview.numberOfViewedFiles++;
4748
} else {
4849
form.classList.remove(viewedStyleClass);
50+
checkbox.removeAttribute('checked');
4951
prReview.numberOfViewedFiles--;
5052
}
5153

0 commit comments

Comments
 (0)