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

[bugfix] event.value is not evaluated when the value is array #5850

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

junamai2000
Copy link

@junamai2000 junamai2000 commented Mar 11, 2024

The conditional form generator is not work properly when IN operator is used.

        $form->select('some_type'))
            ->rules('required')
            ->options([1, 2, 3, 4, 5])
            ->when('in', [
                1,
                2,
            ], function (Form $form) {
                $form->hasMany('xxxx', 'yyyyyy', function (Form\NestedForm $nested_form) use ($form) {
                    // do something
                })->useTable();
            });

In this case above, cascade_groups is generated like this.

var cascade_groups = [{"class":"cascade-type-312d32","operator":"in","value":["1","2"]}];

and hide class is not removed correctly because the value is not expect array.

if(default_value == event.value) {

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

Successfully merging this pull request may close these issues.

1 participant