contributte / forms-bootstrap

👾 Bootstrap 4 + 5 forms for Nette framework
MIT License
19 stars 19 forks source link

Bad Group & Row rendering #55

Closed yosieu closed 2 years ago

yosieu commented 3 years ago

Hello,

you have an error in BootstrapForm rendering. If is defined group witch contains BootstrapRow, then is rendered multiple duplicity rows with their contents and at the end is rendered Group.

Error is in class BootstrapRow, where you don't make $this-setOption(rendered, true);

Thanks for fix it.

Example:

   $row1 = $this->addRow("line1");
    $row1->addCell(6)
            ->addSelect('category', 'Kategorie', $this->category_repository->getIdNameList())
                ->setHtmlAttribute("class", "selectpicker form-control")
                ->setHtmlAttribute("title", "Vyberte ...")
                ->setRequired(true)
                ->getLabelPrototype()
                    ->setClass('required');

    $row1->addCell(6)
            ->addSelect('edition', 'Ročník', Edition::getList())
                ->setHtmlAttribute("class", "selectpicker form-control")
                ->setHtmlAttribute("title", "Vyberte ...")
                ->setRequired(true)
                ->getLabelPrototype()
                    ->setClass('required');

    $group1 = $this->addGroup('Group 1', false)
                    ->add([$row1]);

image

dakorpar commented 2 years ago

@yosieu thanks for reporting this is fixed in master, v0.5.2 released, fix is in it.