Skip to content
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

Multiple groups with draggable items doesnt work without a handle #50

Open
patrykszady opened this issue Apr 6, 2024 · 1 comment
Open

Comments

@patrykszady
Copy link

patrykszady commented Apr 6, 2024

Hi, when recreating the below "Multiple groups with draggable items" the sortable-group.handle is required, if it's removed the item is not draggable. When I remove the <button wire:sortable-group.handle>drag</button> the item is no longer draggable at all. This works in a simple draggable list but doesn't work in groups. I checked with the livewire/sortable package, and it works. Any ideas on how to make the entire <li> function as a draggable button without a handle?

<div wire:sortable-group="updateTaskOrder">
    @foreach ($groups as $group)
        <div wire:key="group-{{ $group->id }}">
            <h4>{{ $group->label }}</h4>

            <ul wire:sortable-group.item-group="{{ $group->id }}" wire:sortable-group.options="{ animation: 100 }">
                @foreach ($group->tasks()->orderBy('order')->get() as $task)
                    <li wire:sortable-group.item="{{ $task->id }}" wire:key="task-{{ $task->id }}">
                        <span>{{ $task->title }}</span>
                        <button wire:sortable-group.handle>drag</button>
                    </li>
                @endforeach
            </ul>
        </div>
    @endforeach
</div>

Thanks.
Patryk

@patrykszady
Copy link
Author

patrykszady commented Apr 7, 2024

Ok, so I just moved wire:sortable-group.handle to the li and it works but is still required where it is not required in a simple single list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant