Skip to content

Checkbox toggle issue #233

@aleswita

Description

@aleswita

Version: 3.0.1

Bug Description

When checkbox marked as required, condition with toggle evaluated always to true and JS hide HTML attribute with ID data every time, if checkbox checked or not.
If commented setRequired, behaviour is OK.

Steps To Reproduce

protected function createComponentForm(): Nette\Application\UI\Form
{
	$form = new Nette\Application\UI\Form();

	$form->addCheckbox('checkbox', 'checkbox')
		->setOmitted()
		->setRequired()
		->addCondition(Nette\Forms\Form::EQUAL, false)
			->toggle('data')
		->endCondition();

	return $form;
}
{form form}
	<div id="data">
		...
	</div>

	{input checkbox}
{/form}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions