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

Filament tabs in foreach active is #11768

Closed
vivere-dally opened this issue Mar 8, 2024 · 1 comment
Closed

Filament tabs in foreach active is #11768

vivere-dally opened this issue Mar 8, 2024 · 1 comment

Comments

@vivere-dally
Copy link

Package

filament/filament

Package Version

v3.2.44

Laravel Version

v10.10

Livewire Version

No response

PHP Version

8.2

Problem description

I used the active tab example provided in the docs, but within a foreach using the loop index to set the correct tab active:

    <x-filament::tabs label="Content tabs">
        @foreach ($tabs as $tab)
            <x-filament::tabs.item
                icon="{{$tab['icon']}}"
                :active="$activeTab === {{$loop->index}}"
                wire:click="$set('activeTab', {{$loop->index}})"
            >
                {{ __($tab['text']) }}
            </x-filament::tabs.item>
        @endforeach
    </x-filament::tabs>

However, there appears to be a parse error:

image

Expected behavior

I would expect the example to work as intended.

If I remove the : before active, then the example is rendered, however since it's not a reactive property, you can't switch tabs.

Steps to reproduce

straight forward

Reproduction repository

https://github.com/filamentphp/filament

Relevant log output

No response

@vivere-dally vivere-dally added bug Something isn't working low priority unconfirmed labels Mar 8, 2024
Copy link

github-actions bot commented Mar 8, 2024

Hey @vivere-dally! 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 Mar 8, 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