Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing custom classes on checkbox in inline edit #1049

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Spilky
Copy link
Contributor

@Spilky Spilky commented Oct 12, 2022

  • \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 (because it takes class from label) 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

@MrVoltz
Copy link

MrVoltz commented Nov 20, 2022

I am having the same issue, I think that in addition to your fix, there should be a condition for TextBase and SelectBox.

@radimvaculik
Copy link
Member

Good for me! 👍 @paveljanda / @f3l1x Please merge it.

@f3l1x
Copy link
Member

f3l1x commented Jan 10, 2025

Please rebase your PR.

- `\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
@Spilky Spilky force-pushed the inline-edit-checkbox-classes-bug branch from d22f09e to bbbd24e Compare January 14, 2025 15:26
@Spilky
Copy link
Contributor Author

Spilky commented Jan 14, 2025

@f3l1x done. There is error for PHPStan and it is not related to my PR:

Error: Ignored error pattern #^Parameter \#1 \$x of method Doctrine\\ORM\\Query\\Expr\:\:like\(\) expects string, Doctrine\\ORM\\Query\\Expr\\Func given\.$# in path /home/runner/work/datagrid/datagrid/src/DataSource/DoctrineDataSource.php was not matched in reported errors.

@radimvaculik
Copy link
Member

@Spilky Fixed @ #1158

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants