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

- `\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
@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.

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.

3 participants