filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.08k stars 2.83k forks source link

Error when using the delete function on repeaters #7893

Closed pochocho closed 1 year ago

pochocho commented 1 year ago

Package

filament/forms

Package Version

v3.0.8

Laravel Version

v10.17.1

Livewire Version

v3.0.0-beta.7

PHP Version

PHP 8.2.8

Problem description

When clicking the delete icon on repeaters, the element does not go away. It clears the data but, it does not remove the repeater element.

This bug is also showing in the demo site when editing an order and trying to delete repeater elements (order items)

Here's a video of it happening on the demo site

https://github.com/filamentphp/filament/assets/1001664/7e34e554-9d98-4fa7-81b5-fa07a1d13ed3

The following console messages appear

image image

Expected behavior

When clicking the delete icon the the entire element should be removed

Steps to reproduce

Create a repeater element. Save a record with multiple repeaters Edit the record Attempt to remove more than 1 repeater

In the demo site, this can be replicated by editing an order

Reproduction repository

https://github.com/filamentphp/demo

Relevant log output

Uncaught TypeError: Cannot read properties of undefined (reading 'element')
    at g._removeEventListeners (select.js?v=3.0.25.0:1:22376)
    at g.destroy (select.js?v=3.0.25.0:1:7833)
    at Proxy.destroy (select.js?v=3.0.25.0:1:95468)
    at livewire.js?id=fc319290:993:25
    at tryCatch (livewire.js?id=fc319290:949:14)
    at evaluate (livewire.js?id=fc319290:973:34)
    at livewire.js?id=fc319290:3178:34
    at livewire.js?id=fc319290:1129:51
    at Array.forEach (<anonymous>)
    at doCleanup (livewire.js?id=fc319290:1129:36)
github-actions[bot] commented 1 year ago

Hey @pochocho! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.