Closed flaviovs closed 5 years ago
What we could do is write some docs with an explanation how to reset forms to form-check*
elements via container configuration.
@samdark what do you think?
You mean widget factory? Yes. That's a good option.
What I mean is: https://www.yiiframework.com/doc/guide/2.0/en/concept-configurations#application-configurations
$config = [
'id' => 'basic',
'basePath' => dirname(__DIR__),
'extensions' => require __DIR__ . '/../vendor/yiisoft/extensions.php',
'container' => [
'definitions' => [
'yii\widgets\LinkPager' => ['maxButtonCount' => 5]
],
'singletons' => [
// Dependency Injection Container singletons configuration
]
]
];
Yes. Meant the same.
Configuring the container and/or templates was my first guess to solve the issue in a global way after the upgrade, but I was really concerned about classes being unconditionally added like this:
Classes on L225-226 were form-check-*
before, and there are many changes like this, where classes added seemingly unconditionally were replaced. That suggests that just configuring/templates may not allow the use of .form-*
classes, but I am not sure about that and to be honest I didn't try it.
What steps will reproduce the problem?
Upgrade to 2.0.5.
What's expected?
Backward compatibility for sites using standard BS4
form-check*
classes.What do you get instead?
Broken layout. Broken functionality.
No way to fix without: 1) reverting commit 94e2ed1; or 2) downgrading to 2.0.4.
Additional info
Issue #150 ~makes BS4 custom controls the default~ forces BS4 custom controls. Although CCs are nice, not all sites want/need it. Some sites might be targeting BS4 classes
.form-check
,.form-check-label
, etc., to implement custom behaviour using other CSS/JS plugins, and not want BS custom control. That's exactly what I am facing now. The problem with #150 is that it makes impossible to revert to standard forms without patching the code.My suggestion: implement a "useCustomControls" property to toggle between standard and custom controls.