Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal Blade component has a problem with Nesting Components #12830

Closed
shebaoting opened this issue May 16, 2024 · 1 comment
Closed

Modal Blade component has a problem with Nesting Components #12830

shebaoting opened this issue May 16, 2024 · 1 comment

Comments

@shebaoting
Copy link

Package

filament/filament

Package Version

3.0

Laravel Version

11

Livewire Version

3.0

PHP Version

8.3

Problem description

Package

Other

Package Version

v3.0.0

How can we help you?

parent component

@foreach ($opportunitys as $opportunity)
    <livewire:company.opportunity.item :$opportunity :key="$opportunity->id" />
    @endforeach

child component

<x-filament::modal id="show-lost">

<form wire:submit="onLost">
    <x-filament::button type="submit" class="float-right">保存</x-filament::button>
</form>
</x-filament::modal>
class Item extends Component
{
    public $opportunity;
    public $opportunityId;
    public function render()
    {
        return view('livewire.company.opportunity.item');
    }


    public function showLost($id){
        $this->opportunityId = $id;
        $this->dispatch('open-modal', id: 'show-lost');
    }

    public function onLost()
    {
        dd($this->opportunityId);
    }

}

In showLost(), the value of $this->opportunityId is available, but the value of $this->opportunityId is not available in onLost(), it is null

If Nesting Components is not used. then everything is fine.

May I ask how this problem can be solved? Is it a bug?

Expected behavior

...

Steps to reproduce

...

Reproduction repository

...

Relevant log output

No response

Copy link

Hey @shebaoting! 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.

Also, it doesn't look like you've provided much information on how to replicate the issue. Please edit your original post with clear steps we need to take.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

1 participant