GedMarc / bootstrap4-dialog

bootstrap4 compatible modal dialog based on nakupanda.github.io/bootstrap3-dialog
https://nakupanda.github.io/bootstrap3-dialog/
65 stars 31 forks source link

setCloseByBackdrop not work #30

Open Hessuss opened 4 years ago

Hessuss commented 4 years ago

Hi. Cannot prevent modal close by backdrop click after modal shown.

Methods: setCloseByBackdrop(false); setCloseByKeyboard(false);

not works.

Method: setClosable(false);

only remove "x" sign. Backdrop click still active.

http://jsfiddle.net/tpy5eogs/

Can you help me?

GedMarc commented 4 years ago

Hi,

Previously reported + fixed, please use the latest release 👍

Thanks

@4.3.6 in URL - I've learnt however that jsDelivr needs an update.json file to auto update

<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.js"></script>
<link href="https://cdn.jsdelivr.net/gh/GedMarc/bootstrap4-dialog@4.3.6/dist/css/bootstrap-dialog.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/gh/GedMarc/bootstrap4-dialog@4.3.6/dist/js/bootstrap-dialog.js"></script>
GedMarc commented 4 years ago

Please also check the example index for the correct syntax :) and demonstration of closable/not closable :)

closable must be true, in order to set closable settings, e.g. for a button to close it :)

        BootstrapDialog.show({
            message: 'Hi Apple!',
            message: 'You can not close this dialog by clicking outside and pressing ESC key.',
            closable: true,
            closeByBackdrop: false,
            closeByKeyboard: false,
            buttons: [{
                label: 'Close the dialog',
                action: function(dialogRef){
                    dialogRef.close();
                }
            }]
        });
Hessuss commented 4 years ago

Still not work even from your files from examples directory.

Scenario: Open closable dialog, then click on send button, then make button disabled and modal not closable in any way. Like nakupanda show on : http://nakupanda.github.io/bootstrap3-dialog/ in 'Manipulating Buttons' section, please take a look on his site.

and my fiddle with youurs scripts v4.3.6 http://jsfiddle.net/4g9x0L8u/1/

on click 'prevent' button still can close by backdrop click.

Please look at this and tell me , i do something wrong or its a bug?

GedMarc commented 4 years ago

Pls look at this one? rather than starting off negative start on a positive flow - i believe this meets the requirements? it is something to look at though

http://jsfiddle.net/k0jtmvL8/1/

Hessuss commented 4 years ago

Hi, thanx for answer but still not work :) Even i set in your code : dialogRef.setClosable(true); dialogRef.setCloseByBackdrop(true); dialogRef.setCloseByKeyboard(true); after click button "Dialog closable" still cannot close dialog by cliking on backdrop.

http://jsfiddle.net/3hybx5jf/

GedMarc commented 4 years ago

Can you please check on the latest release?

Hessuss commented 4 years ago

Hi, i set bootstrap version to 4.5.2 and your bootstrap-dialog version to 4.3.8 and still when i open dialog as closable and then click button "Dialog UNCLOSABLE" i can close dialog by click on backdrop. When i open dialog as unclosable and then click on "dialog closable" button i cannot close dialog by backdrop click. Please take a look on fiddle: http://jsfiddle.net/xj6o85hy/