yii2-selectize-widget icon indicating copy to clipboard operation
yii2-selectize-widget copied to clipboard

Remove the Bootstrap 3 dependency

Open ivan-cc opened this issue 6 years ago • 1 comments

I use Bootstrap 4 (throgh a component). After I start using your component, Bootstrap 3 connects and my styles get overriden.

It happens because your component uses dependency in src/SelectizeAsset.php 'yii\bootstrap\BootstrapAsset'

Is it possible to remove this dependency or make it optional?

PS: also it would be great to be able to disconnect/change (in src/SelectizeAsset.php) css-file 'css/selectize.bootstrap3.css'

ivan-cc avatar May 29 '18 17:05 ivan-cc

Hi,

I encountered the same problem and eventually came to a solution. You can extend the component and the assets file. Then call your own asset file in the registerClientScript() method of the component and override the original assets call doing:

public function init()
{
    parent::init();
    // resetting BootstrapAsset to not load own css and js files
    \Yii::$app->assetManager->bundles['yii\\bootstrap\\BootstrapAsset'] = [
        'css' => [],
        'js' => []
    ];
}

chtidom avatar Feb 14 '19 14:02 chtidom