Fix drag drop lists. Part 1.

Thanks to xet7 !

Related #5951
This commit is contained in:
Lauri Ojansivu 2025-10-19 21:38:55 +03:00
parent 3257110673
commit 324f3f7794
11 changed files with 210 additions and 109 deletions

View file

@ -191,6 +191,11 @@ body.list-resizing-active * {
margin-right: 0 !important;
/* Ensure proper display */
display: inline-block !important;
/* Ensure it's clickable and shows proper cursor */
cursor: move !important;
pointer-events: auto !important;
/* Add some padding for better clickability */
padding: 4px !important;
}
/* Ensure buttons maintain original positioning */

View file

@ -150,26 +150,13 @@ BlazeComponent.extendComponent({
});
this.autorun(() => {
if (Utils.isTouchScreenOrShowDesktopDragHandles()) {
$cards.sortable({
handle: '.handle',
});
} else {
$cards.sortable({
handle: '.minicard',
// Prevent sortable from interfering with file drag and drop
start: function(event, ui) {
// Check if this is a file drag operation
const dataTransfer = event.originalEvent?.dataTransfer;
if (dataTransfer && dataTransfer.types && dataTransfer.types.includes('Files')) {
// Cancel sortable for file drags
return false;
}
},
});
}
if ($cards.data('uiSortable') || $cards.data('sortable')) {
if (Utils.isTouchScreenOrShowDesktopDragHandles()) {
$cards.sortable('option', 'handle', '.handle');
} else {
$cards.sortable('option', 'handle', '.minicard');
}
$cards.sortable(
'option',
'disabled',

View file

@ -70,9 +70,9 @@ template(name="listHeader")
| ⬅️
| ➡️
a.js-open-list-menu(title="{{_ 'listActionPopup-title'}}") | ☰
if currentUser.isBoardAdmin
if isTouchScreenOrShowDesktopDragHandles
a.list-header-handle.handle.js-list-handle |
if currentUser.isBoardMember
unless currentUser.isCommentOnly
a.list-header-handle.handle.js-list-handle |
template(name="editListTitleForm")
.list-composer