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
19.56k stars 2.98k forks source link

When I do any search, a black modal box is generated before the page refreshes #14918

Closed cnpap closed 1 hour ago

cnpap commented 1 hour ago

Package

filament/filament

Package Version

3.2

Laravel Version

^10.10

Livewire Version

^3.5

PHP Version

8.1

Problem description

When I do an arbitrary search, there is a black modal box that covers the page before refreshing, the search takes effect, but the black popup doesn't close.

<form wire:submit.prevent="callMountedFormComponentAction">
        <div aria-modal="true" role="dialog" x-data="{
        isOpen: false,

        livewire: null,

        close: function () {
            this.isOpen = false

            this.$refs.modalContainer.dispatchEvent(
                new CustomEvent('modal-closed', { id: 'Uxkn5gjA7CvGrS2eWT54-form-component-action' }),
            )
        },

        open: function () {
            this.isOpen = true

            this.$refs.modalContainer.dispatchEvent(
                new CustomEvent('modal-opened', { id: 'Uxkn5gjA7CvGrS2eWT54-form-component-action' }),
            )
        },
    }" x-on:close-modal.window="if ($event.detail.id === 'Uxkn5gjA7CvGrS2eWT54-form-component-action') close()" x-on:open-modal.window="if ($event.detail.id === 'Uxkn5gjA7CvGrS2eWT54-form-component-action') open()" x-trap.noscroll="isOpen" wire:ignore.self="" class="fi-modal block" data-immersive-translate-walked="3fb33b97-ec96-4874-b66d-1c9a6dae62e6">
    <!--[if BLOCK]><![endif]--><!--[if ENDBLOCK]><![endif]-->

    <div x-show="isOpen" x-transition.duration.300ms.opacity="" class="fixed inset-0 z-40 min-h-full overflow-y-auto overflow-x-hidden transition flex items-center">
        <div aria-hidden="true" x-on:click="$dispatch('close-modal', { id: 'Uxkn5gjA7CvGrS2eWT54-form-component-action' })" class="fi-modal-close-overlay fixed inset-0 bg-gray-950/50 dark:bg-gray-950/75 cursor-pointer" style="will-change: transform"></div>

        <div x-ref="modalContainer" class="pointer-events-none relative w-full transition my-auto p-4" x-on:modal-closed.stop="const mountedFormComponentActionShouldOpenModal = false

                if (mountedFormComponentActionShouldOpenModal) {
                    $wire.unmountFormComponentAction(false)
                }">
            <div x-data="{ isShown: false }" x-init="
                    $nextTick(() => {
                        isShown = isOpen
                        $watch('isOpen', () => (isShown = isOpen))
                    })
                " x-on:keydown.window.escape="$dispatch('close-modal', { id: 'Uxkn5gjA7CvGrS2eWT54-form-component-action' })" x-show="isShown" x-transition:enter="duration-300" x-transition:leave="duration-300" x-transition:enter-start="scale-95" x-transition:enter-end="scale-100" x-transition:leave-start="scale-95" x-transition:leave-end="scale-100" class="fi-modal-window pointer-events-auto relative flex w-full cursor-default flex-col bg-white shadow-xl ring-1 ring-gray-950/5 dark:bg-gray-900 dark:ring-white/10 mx-auto rounded-xl hidden max-w-sm" data-has-alpine-state="true">
                <!--[if BLOCK]><![endif]--><!--[if ENDBLOCK]><![endif]-->

                <!--[if BLOCK]><![endif]--><!--[if ENDBLOCK]><![endif]-->

                <!--[if BLOCK]><![endif]--><!--[if ENDBLOCK]><![endif]-->
            </div>
        </div>
    </div>
</div>
    </form>

Expected behavior

Refresh the form data after searching, but don't have pop-ups!

Steps to reproduce

I've fully patched migration and seed, and the sample project helps us to easily reproduce the problem.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/cnpap/yujian-admin

Relevant log output

No response

Donate 💰 to fund this issue

Fund with Polar

danharrin commented 1 hour ago

Please provide the exact Filament and Livewire version. php artisan about

cnpap commented 1 hour ago

I've installed Livewire and updated the version info on the issue

danharrin commented 1 hour ago

Livewire is currently broken, and you have the broken version installed. This is because Filament is set to "filament/filament": "3.2", instead of "filament/filament": "^3.2",. Change this and update Composer to receive the latest Filament version and downgrade Livewire off the version that is broken.

cnpap commented 1 hour ago

okok, problem solved.