Skip to content

Unable to set custom class for label of RadioList item #31

Description

@peterpp

Use case: custom renderer with method:

public function renderControl(Nette\Forms\IControl $control)
{
    ...
    if ($control instanceof \Nette\Forms\Controls\RadioList) {
         $control->getLabelPrototype()->class("my-class", TRUE);
    }
}

This custom class is not propagated to final <label> tag. The problem is in method RadioList::getControl() on line 92. Here we can find only this array for label attributes:

array('for:' => $ids)

On the other hand, CheckboxList works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions