open-admin-org / open-admin

open-admin forked from z-song/laravel-ladmin. Removing jquery, now based on Bootstrap5, vanilla JS
https://open-admin.org
MIT License
244 stars 71 forks source link

Setting a required rule for a checkbox on a popup form will prompt for all checks #71

Open takagaki-bb opened 1 year ago

takagaki-bb commented 1 year ago

Describe the bug If set a required rule for a checkbox on a popup form, the rule cannot be used because all checks are required.

To Reproduce Set the following in the action class.

    public function form()
    {
        $this->checkbox('tests', ' TEST')
            ->rules(['array', 'required'])
            ->stacked()
            ->options([
                1 => 'test1',
                2 => 'test2',
                3 => 'test3',
            ]);
    }

If you try to submit with this, you will be asked to check everything.

image

Expected behavior If one of these is checked, please make sure it can be sent.

System

open-admin-org commented 9 months ago

@takagaki-bb thanks for reporting. Now fixed in dev-branch will release soon.