open-admin icon indicating copy to clipboard operation
open-admin copied to clipboard

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

Open takagaki-bb opened this issue 1 year ago • 1 comments

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 version v1.0.27
  • PHP version 8.1.2
  • Laravel Version v9.52.7
  • OS: Windows 10
  • Browser Chrome

takagaki-bb avatar May 31 '23 05:05 takagaki-bb

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

open-admin-org avatar Nov 05 '23 11:11 open-admin-org