From d22f09edc6a0d681c899aef9cdde8fd8ed9f459b Mon Sep 17 00:00:00 2001 From: davidspilka Date: Wed, 12 Oct 2022 14:46:23 +0200 Subject: [PATCH] Fixing custom classes on checkbox in inline edit - `\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 --- src/InlineEdit/InlineEdit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/InlineEdit/InlineEdit.php b/src/InlineEdit/InlineEdit.php index 33733ff7c..167e49eed 100644 --- a/src/InlineEdit/InlineEdit.php +++ b/src/InlineEdit/InlineEdit.php @@ -219,7 +219,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 input-sm form-control-sm'); }