Skip to content

Commit

Permalink
IcingaFormDecorator: Generate a persistent ID for checkboxes
Browse files Browse the repository at this point in the history
fixes #113
  • Loading branch information
nilmerg committed Feb 1, 2023
1 parent 573836e commit 3c5e7ee
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FormDecorator/IcingaFormDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ protected function assembleElement()
protected function createCheckbox(CheckboxElement $checkbox)
{
if (! $checkbox->getAttributes()->has('id')) {
$checkbox->setAttribute('id', Window::generateId());
$checkbox->setAttribute(
'id',
$checkbox->getName() . '_' . Window::getInstance()->getContainerId()
);
}

$checkbox->getAttributes()->add('class', 'sr-only');
Expand Down

0 comments on commit 3c5e7ee

Please sign in to comment.