Browse Source

Mobile fix for Project view: Add delay to Sortable.js on mobile, to ensure scrolling is possible. (#22152)

Mobile / touch devices currently get "hung up" on the sortable action,
preventing any ability to visually scroll through the Project board to
see issues.

Solution: Sortable.js has a built-in fix using `delayOnTouchOnly`

BEFORE

https://user-images.githubusercontent.com/24665/208266817-6f2968b7-4788-4656-a941-f85b25fc59d5.mp4

AFTER

https://user-images.githubusercontent.com/24665/208266822-3d327002-7a9d-41cf-9890-6d6b8dcb17be.mp4

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
tags/v1.19.0-rc0
Nathaniel Sabanski 1 year ago
parent
commit
8e267afd35
No account linked to committer's email address
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      web_src/js/features/repo-projects.js

+ 4
- 0
web_src/js/features/repo-projects.js View File

@@ -49,6 +49,8 @@ async function initRepoProjectSortable() {
filter: '[data-id="0"]',
animation: 150,
ghostClass: 'card-ghost',
delayOnTouchOnly: true,
delay: 500,
onSort: () => {
boardColumns = mainBoard.getElementsByClassName('board-column');
for (let i = 0; i < boardColumns.length; i++) {
@@ -76,6 +78,8 @@ async function initRepoProjectSortable() {
ghostClass: 'card-ghost',
onAdd: moveIssue,
onUpdate: moveIssue,
delayOnTouchOnly: true,
delay: 500,
});
}
}

Loading…
Cancel
Save