Skip to content

Table/modal visual bug on validation error with wire:transition #2313

@BartekJan1128

Description

@BartekJan1128

Flux version

2.10.2

Livewire version

4.0.1

Tailwind version

4.0.0

Browser and Operating System

Edge, Opera on Windows 11

What is the problem?

After submitting a form with a validation error, table rows with wire:transition flash through the modal.

Code snippets to replicate the problem

<?php

use Livewire\Attributes\Layout;
use Livewire\Component;

new #[Layout('layouts::app')]
class extends Component {

    public $data = [
        "A", "B", "C", "D", "E"
    ];

    public $new = "";


    public function add()
    {
        $this->validate([
            "new" => 'string|required|not_in:data'
        ]);
    }

};
?>

<div class="p-2">
    <div class="flex flex-col sm:flex-row justify-between items-start sm:items-center mb-6">
        <flux:modal.trigger name="add">
            <flux:button variant="primary" class="w-full sm:w-auto">
                <flux:icon.plus/>
                Add
            </flux:button>
        </flux:modal.trigger>
    </div>

    <flux:table>
        <flux:table.columns>
            <flux:table.column class="pl-2!">A</flux:table.column>
            <flux:table.column>B</flux:table.column>
            <flux:table.column>C</flux:table.column>
            <flux:table.column align="end" class="pr-2!">D</flux:table.column>
        </flux:table.columns>
        <flux:table.rows>
            @foreach ($this->data as $d)
                <flux:table.row class="odd:bg-gray-100" wire:transition :key="$d">
                    <flux:table.cell class="pl-2!">
                        {{$d}}
                    </flux:table.cell>
                    <flux:table.cell variant="strong">....</flux:table.cell>
                    <flux:table.cell variant="strong">...</flux:table.cell>
                    <flux:table.cell align="end" class="pr-2!">
                        <flux:button variant="primary" color="yellow" icon="pencil-square" size="sm"></flux:button>
                    </flux:table.cell>
                </flux:table.row>
            @endforeach
        </flux:table.rows>
    </flux:table>

    <flux:modal name="add" class="sm:w-[50%] max-w-full">
        <form wire:submit="add" class="space-y-6">
            <div>
                <flux:heading size="lg" class="text-gray-900 dark:text-gray-100">New</flux:heading>
            </div>

            <flux:input wire:model="new" label="New" placeholder="..."/>

            <div class="flex justify-end pt-4">
                <flux:button type="submit" icon="plus" variant="primary">
                    Add
                </flux:button>
            </div>
        </form>
    </flux:modal>
</div>

Screenshots/ screen recordings of the problem

Bug.mp4

How do you expect it to work?

Same behavior as without wire:transition

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions