asantibanez / laravel-blade-sortable

Custom Blade components to add sortable/drag-and-drop HTML elements in your apps.
MIT License
409 stars 79 forks source link

$dom.getAttribute is not a function #8

Closed maximus1127 closed 3 years ago

maximus1127 commented 3 years ago

Hi, trying to use this with a livewire component.

                @foreach ($p1->chunk(4) as $chunk)
                <div class="row" style="background-color: #8cdba9; margin-bottom: 7px; padding: 10px;">
                    <x-laravel-blade-sortable::sortable>
                        @foreach ($chunk as $item)
                          <x-laravel-blade-sortable::sortable-item as='label' class="checkbox-inline col-3" sort-key="{{$item->order_position}}"  drag-handle="drag-handle">
                            {{-- <label class="checkbox-inline col-3"> --}}
                                <input type="checkbox" value="1" id="item{{$item->id}}" @if (in_array($item->id, $currentConfigs)) checked @endif wire:click="updateConfig({{ $item->id }})"> {!! $item->value !!}
                            {{-- </label> --}}
                        </x-laravel-blade-sortable::sortable-item>
                        @endforeach
                    </x-laravel-blade-sortable::sortable>
                    </div>
                @endforeach

When I do this and try to click my element, the console prints this error: image

I have my scripts in the file listed in this order: @livewire /js/app.js and lastly the

I have installed alpine and sortable through NPM and run npm dev to compile the scripts (within Laravel) after including/requiring the libraries in the app/bootstrap.js files.

What is causing this error?