bootstrap4-dialog icon indicating copy to clipboard operation
bootstrap4-dialog copied to clipboard

setCloseByBackdrop not work

Open Hessuss opened this issue 5 years ago • 7 comments

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?

Hessuss avatar Sep 28 '20 17:09 Hessuss

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/[email protected]/dist/css/bootstrap-dialog.css" rel="stylesheet" type="text/css" />
<script src="https://cdn.jsdelivr.net/gh/GedMarc/[email protected]/dist/js/bootstrap-dialog.js"></script>

GedMarc avatar Sep 28 '20 22:09 GedMarc

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();
                }
            }]
        });

GedMarc avatar Sep 28 '20 22:09 GedMarc

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?

Hessuss avatar Sep 29 '20 11:09 Hessuss

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/

GedMarc avatar Sep 29 '20 12:09 GedMarc

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/

Hessuss avatar Sep 29 '20 16:09 Hessuss

Can you please check on the latest release?

GedMarc avatar Oct 14 '20 15:10 GedMarc

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/

Hessuss avatar Oct 15 '20 09:10 Hessuss