Skip to content

v4 Charts not updating when in non-active tabs #16599

@binaryfire

Description

@binaryfire

Package

filament/filament

Package Version

4-beta6

Laravel Version

12

Livewire Version

3

PHP Version

8.4

Problem description

Not sure if I'm doing something wrong, but I can't get charts in nested non-active tabs to render properly on page load, or update properly. The video shows the problem using the reproduction repo.

I'm using this to render the chart in 3 places:

Livewire::make(StatChartWidget::class, fn ($record) => [
        'record' => $record,
    ])
    ->key(Str::random(10))

In the video, the following happens:

1. Page load

  • Chart in the body loads ✅
  • Chart in the visible tab loads ✅
  • Chart in the non-visible nested "Data" tab is empty ❌

2. "Refresh data" to update the model's data attribute while the 'Data' tab is not active

  • Chart in the body refreshes ✅
  • Chart in the visible tab refreshes ✅
  • Chart in the non-visible nested "Data" tab is not refreshed ❌

2. "Refresh data" to update the model's data attribute while the 'Data' tab is active

  • Chart in the body refreshes ✅
  • Chart in the visible tab refreshes ✅
  • Chart in the non-visible nested "Data" tab refreshes ✅

I'm using #[Reactive] but I also tried refreshing via an event, and tried ->lazy(). Neither helped.

1080p_WVyR.mp4

Expected behavior

Charts / Livewire components in a page should render and update correctly regardless of what tab they're in.

Steps to reproduce

  1. Clone repo
  2. Run migrate:fresh --seed to seed statistics table
  3. Go to Statistics resource
  4. See video and steps outlined in description to reproduce

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

https://github.com/binaryfire/filament-bug-reproduction

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Todo

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions