Skip to content

Commit c841503

Browse files
[6.x] Various drag & drop fixes (#14219)
1 parent 5dd6314 commit c841503

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

resources/js/components/fieldtypes/bard/Set.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
'bg-gray-200/50 dark:bg-gray-950/35 rounded-b-none border-b-gray-300! dark:border-b-white/10!': !collapsed
2424
}"
2525
>
26-
<Icon data-drag-handle name="handles" class="size-4 cursor-grab text-gray-400" v-if="!isReadOnly" />
26+
<span v-if="!isReadOnly" draggable="true" data-drag-handle class="flex cursor-grab">
27+
<Icon name="handles" class="size-4 text-gray-400" />
28+
</span>
2729
<button type="button" class="show-focus-within_target flex flex-1 items-center gap-4 p-2 min-w-0 focus:outline-none cursor-pointer" @click="toggleCollapsedState">
2830
<Badge size="lg" :pill="true" color="white" class="px-3">
2931
<span v-if="isSetGroupVisible" class="flex items-center gap-2">

resources/js/components/inputs/relationship/RelationshipInput.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ export default {
286286
if (this.initializing) return;
287287
this.$emit('item-data-updated', data);
288288
},
289+
290+
items(items, oldItems) {
291+
if (items.length > 0 && oldItems.length === 0) {
292+
if (this.canReorder) {
293+
this.$nextTick(() => this.makeSortable());
294+
}
295+
}
296+
},
289297
},
290298
291299
methods: {

0 commit comments

Comments
 (0)