Skip to content

[PRO] FluxUI chart breaks inside wire:sort without wire:sort:handle #2578

@marcheffels

Description

@marcheffels

Flux version

v2.13.2

Livewire version

v4.2.4

Tailwind version

v4.2.2

Browser and Operating System

Firefox on Arch Linux

What is the problem?

When a flux:chart is placed inside a wire:sort:item without a wire:sort:handle the dragging to reorder items stops working and a TypeError is thrown in the browser console.

Uncaught TypeError: can't access property "querySelector", tmpl.content is undefined

Code snippets to replicate the problem

<?php

use Illuminate\Support\Collection;
use Livewire\Component;

new class extends Component {
    public array $tasks = [
        [
            'id' => 1,
            'title' => "Title 1",
        ],[
            'id' => 2,
            'title' => "Title 2",
        ],[
            'id' => 3,
            'title' => "Title 3",
        ],
    ];

    public function handleSort($id, $position): void
    {
        dump($id, $position);
    }
};
?>

<div>
    <div class="grid grid-cols-3 gap-4" wire:sort="handleSort">
        @foreach ($tasks as $task)
            <flux:card class="overflow-hidden min-w-[12rem]" wire:key="{{ $task['id'] }}" wire:sort:item="{{ $task['id'] }}">
                <flux:text>Revenue</flux:text>
                <flux:heading size="xl" class="mt-2 tabular-nums">$12,345 {{ $task['title'] }}</flux:heading>
                <flux:chart class="-mx-8 -mb-8 h-[3rem]" :value="[10, 12, 11, 13, 15, 14, 16, 18, 17, 19, 21, 20]">
                    <flux:chart.svg gutter="0">
                        <flux:chart.line class="text-sky-200 dark:text-sky-400" />
                        <flux:chart.area class="text-sky-100 dark:text-sky-400/30" />
                    </flux:chart.svg>
                </flux:chart>
            </flux:card>
        @endforeach
    </div>
</div>

Screenshots/ screen recordings of the problem

Image

How do you expect it to work?

No console errors. Items are draggable regardless of whether a flux:chart is present inside the wire:sort:item.

Please confirm (incomplete submissions will not be addressed)

  • I have provided easy and step-by-step instructions to reproduce the bug.
  • I have provided code samples as text and NOT images.
  • I understand my bug report will be closed if I haven't met the criteria above.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions