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

Select filter resets after apply others #2822

Closed
ShamazinGG opened this issue Apr 11, 2024 · 1 comment
Closed

Select filter resets after apply others #2822

ShamazinGG opened this issue Apr 11, 2024 · 1 comment
Assignees
Labels

Comments

@ShamazinGG
Copy link
Contributor

ShamazinGG commented Apr 11, 2024

Describe the bug
Select filter resets after apply others, when a list is passed to the options method of a Select class.
It happens coz in src/Screen/Fields/Select.php 74 $isOptionList is true. Why do we need this check?
To Reproduce
Steps to reproduce the behavior:

  1. Create Filter Like this:
class CoolFilter extends Filter
{
    public function display(): array
    {
        return [
            Select::make('foo')
                ->empty()
                ->value($this->request->get('foo'))
                ->options([
                         0 => 'value0',
                         1 => 'value1',
                         2 => 'value2'
                ])
                ->title('bar')
        ];
     }
     //other default filter code
    }
  1. Add it to your FiltersLayout
  2. Create any other filter and add it to same FiltersLayout
  3. Apply Filter from s.1(CoolFilter) and then apply any other

Facted behavior
Select filter resets, applied only last filter

Expected behavior
Both filters applied

Server (please complete the following information):

  • Platfrom Version: 14.16.0
  • Laravel Version: 10.34.2
  • PHP Version: 8.3.0

Additional context
In my project i customized select.blade.php and it works for me, but i`m not sure is a good solution, coz $isOptionList variable is not using in select.blade.php

Possible PR:
#2821

@ShamazinGG
Copy link
Contributor Author

found the solution in #2782

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants