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

Close preview button not working #1865

Open
muramidaza opened this issue Jun 13, 2024 · 2 comments
Open

Close preview button not working #1865

muramidaza opened this issue Jun 13, 2024 · 2 comments
Labels

Comments

@muramidaza
Copy link

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

@kartik-v
Copy link
Owner

kartik-v commented Aug 6, 2024

Not sure I can reproduce this. Can you check your console log for any javascript errors? Are you trying to have two bootstrap modals or something (like the fileinput widget inside another modal) which may conflict with the file input preview modal?

@muramidaza
Copy link
Author

For some reason, when using AdminLTE, the problem disappeared

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants