laravel / nova-issues

554 stars 35 forks source link

Two filters with the same class are not syncing values between eachother #4495

Closed KasparRosin closed 2 years ago

KasparRosin commented 2 years ago

Description:

Two of the same filters (with the same filter-key aka class) do not sync values between each other.

https://user-images.githubusercontent.com/33309407/176368493-351ee24e-4df8-4d7e-97ae-7824085cf0e4.mp4 In laravel nova version 3, you can see that the two identical filters sort-of sync values between each other. Though the example with vanilla nova is janky, I hope it will get across the point.

Now, here is how it looks in laravel nova 4. https://user-images.githubusercontent.com/33309407/176368360-0b3442cf-2f6a-4be4-93d1-3e60cec6cf57.mp4

Here is the filters response in laravel nova 4 image

Though this probably wont ever be an issue with vanilla nova, this does become a problem with custom packages that implement filters outside of the FilterMenu component. Example: https://github.com/outl1ne/nova-detached-filters

This functionality worked in version 3, which is why it seems like a bug since filters are built on top of vuex and should be using the same state.

Detailed steps to reproduce the issue on a fresh Nova installation:

Create a filter and include it twice in resource filters() function return.

    public function filters(Request $request)
    {
        return [
            ExampleFilter::make(),
            ExampleFilter::make(),
        ];
    }
crynobone commented 2 years ago

Majority of the changes were done to make it compatible with Vue 3, we wouldn't have changed those parts otherwise.