kartik-v / yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 4.x/3.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)
Other
229 stars 96 forks source link

Button Close preview window not working #194

Open muramidaza opened 5 months ago

muramidaza commented 5 months ago

The widget works fine. The files are downloaded and displayed. But the Close preview window button does not work. That is, when I click on it, the modal preview window does not close. There are no errors in the console. Im using bootstrap 5

        $fileForm = $form->field($requestFilesForm, 'uploadFiles[]')->widget(FileInput::class, [
            'language' => 'ru',
            'options' => [
                'multiple' => true,
                'accept' => '',
            ],
            'pluginOptions' => [
                'previewFileType' => 'image',
                'deleteUrl' => Url::to(['delete-file'],true),
                'uploadUrl' => $model->id ? Url::to(['upload-files', 'id' => $model->id]) : null,
                'uploadExtraData' => [
                    'id' => $model->id,
                ],
                'overwriteInitial' => false,
                'showPreview' => true,
                'showClose' => false,
                'initialPreview' => $files,
                'initialPreviewFileType' => 'image',
                'initialPreviewAsData' =>true,
                'initialPreviewConfig' => $initialPreviewConfig,
                'pluginEvents' => [
                    "fileuploaded" => "function(event, data, previewId, index) { console.log(data) }",
                ],
                'maxFileSize' => 50000
            ],
        ])->label('Прикрепленные файлы');

This button has a click event from yii.js. As I understand it, it will float up to kvFileinputModal. But there is no click event on it, there is a mousedown from bootstrap.js and it seems that it is not intercepted