Skip to content

Commit ee19a33

Browse files
committed
avoid scrollbar flicker when show/hide the checks
1 parent 95062f1 commit ee19a33

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
export function initRepoPullRequestCommitStatus() {
22
for (const btn of document.querySelectorAll('.commit-status-hide-checks')) {
3+
const panel = btn.closest('.commit-status-panel');
4+
const list = panel.querySelector('.commit-status-list');
35
btn.addEventListener('click', () => {
4-
const panel = btn.closest('.commit-status-panel');
5-
const list = panel.querySelector('.commit-status-list');
6-
list.style.maxHeight = list.style.maxHeight ? '' : '0px';
6+
list.style.maxHeight = list.style.maxHeight ? '' : '0px'; // toggle
7+
list.style.overflow = 'hidden'; // hide scrollbar when hiding
78
btn.textContent = btn.getAttribute(list.style.maxHeight ? 'data-show-all' : 'data-hide-all');
89
});
10+
list.addEventListener('animationend', () => list.style.overflow = '');
911
}
1012
}

0 commit comments

Comments
 (0)