Skip to content

Commit

Permalink
Fixing custom classes on checkbox in inline edit
Browse files Browse the repository at this point in the history
- `\Nette\Forms\Controls\Checkbox::getControl` returns label part and control part like one ``\Nette\Utils\Html` and then `$control->getControl()->getAttribute('class')` is always null and custom defined classes are always overwritten by `$control->setAttribute('class', 'form-control input-sm form-control-sm');`
- fixed by using `\Nette\Forms\Controls\BaseControl::getControlPrototype` which always returns only control part without label part
  • Loading branch information
Spilky committed Jan 14, 2025
1 parent af2dc7a commit bbbd24e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/InlineEdit/InlineEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public function addControlsClasses(Container $container): void
break;

default:
if ($control->getControl()->getAttribute('class') === null) {
if ($control->getControlPrototype()->getAttribute('class') === null) {
$control->setAttribute('class', 'form-control form-control-sm');
}

Expand Down

0 comments on commit bbbd24e

Please sign in to comment.