Skip to content

Color Picker crashes page with pagination #2656

Description

@TijsDeMulWeb

Flux version

v2.14.1

Livewire version

v4.3.1

Tailwind version

v4.3.1

Browser and Operating System

Chrome on macOS

What is the problem?

When a Livewire component containing a flux:color-picker (with its default hue/alpha flux:color-picker.slider) is destroyed and re-mounted as part of a Livewire pagination request (e.g. a per-row component with a :key based on the row's id, where pagination causes a different row/component to be rendered), the browser tab freezes completely and becomes unresponsive in Chromium-based browsers (Chrome, Arc). It does not happen in Safari.

Breaking into the frozen page with the DevTools debugger shows execution stuck inside updateTicks() of the internal ui-slider element used by the color-picker's hue/alpha sliders, suggesting an infinite reactive loop (state.setValue → onChange → DOM update → re-triggers setValue) when the custom element is re-initialized after the old instance's listeners/observers were never cleaned up.

Replacing flux:color-picker with a plain <flux:input type="color"> resolves the freeze. Using flux:color-picker with a custom slot (swatches + hex input only, omitting flux:color-picker.slider) still freezes, so itself (not just the slider) appears to be involved.

Code snippets to replicate the problem

<?php

use App\Models\Post;
use Livewire\Component;
use Livewire\WithPagination;
use Livewire\Attributes\Computed;

new class extends Component {
    use WithPagination;

    #[Computed]
    public function posts()
    {
        return Post::query()->paginate(1);
    }
}; ?>

<div>
    @foreach ($this->posts as $post)
        <livewire:post-edit-modal :post="$post" :key="'post-edit-modal-'.$post->id" />
    @endforeach

    {{ $this->posts->links() }}
</div>
{{-- post-edit-modal.blade.php --}}
<?php

use App\Models\Post;
use Livewire\Component;

new class extends Component {
    public Post $post;
    public string $color = '#000000';

    public function mount(Post $post): void
    {
        $this->post = $post;
        $this->color = $post->color;
    }
}; ?>

<flux:modal :name="'edit-post-'.$post->id" class="max-w-lg">
    <flux:color-picker dropper copyable type="button" wire:model="color" format="hex" label="Color" />
</flux:modal>

Steps to reproduce:

Have at least 2 records so pagination shows 2 pages.
Load the page (works fine).
Click the pagination "next page" link.
Tab freezes and becomes unresponsive (Chrome/Arc). Force-quit required.

Screenshots/ screen recordings of the problem

Screen.Recording.2026-06-15.at.21.10.43.mov

How do you expect it to work?

Clicking pagination should re-render the row/modal for the new page's record without freezing the browser, same as in Safari.

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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