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 #4

Merged
merged 1 commit into from
Oct 14, 2022

Conversation

Spilky
Copy link

@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

- `\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 merged commit 7ec5d9f into master Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant