Skip to content

fixed incorrect page navigation with up and down arrow on last item of dashboard repos #34570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions web_src/js/components/DashboardRepoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ export default defineComponent({
this.searchRepos();
},

changePage(page: number) {
async changePage(page: number) {
if (this.isLoading) return;

this.page = page;
if (this.page > this.finalPage) {
this.page = this.finalPage;
Expand All @@ -229,7 +231,7 @@ export default defineComponent({
}
this.repos = [];
this.counts[`${this.reposFilter}:${this.archivedFilter}:${this.privateFilter}`] = 0;
this.searchRepos();
await this.searchRepos();
},

async searchRepos() {
Expand Down Expand Up @@ -299,7 +301,7 @@ export default defineComponent({
return commitStatus[status].color;
},

reposFilterKeyControl(e: KeyboardEvent) {
async reposFilterKeyControl(e: KeyboardEvent) {
switch (e.key) {
case 'Enter':
document.querySelector<HTMLAnchorElement>('.repo-owner-name-list li.active a')?.click();
Expand All @@ -308,7 +310,7 @@ export default defineComponent({
if (this.activeIndex > 0) {
this.activeIndex--;
} else if (this.page > 1) {
this.changePage(this.page - 1);
await this.changePage(this.page - 1);
this.activeIndex = this.searchLimit - 1;
}
break;
Expand All @@ -317,17 +319,17 @@ export default defineComponent({
this.activeIndex++;
} else if (this.page < this.finalPage) {
this.activeIndex = 0;
this.changePage(this.page + 1);
await this.changePage(this.page + 1);
}
break;
case 'ArrowRight':
if (this.page < this.finalPage) {
this.changePage(this.page + 1);
await this.changePage(this.page + 1);
}
break;
case 'ArrowLeft':
if (this.page > 1) {
this.changePage(this.page - 1);
await this.changePage(this.page - 1);
}
break;
}
Expand Down