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

Prevent multiple confirm button actions from being triggered #565

Open
sgregpa opened this issue Nov 18, 2022 · 0 comments
Open

Prevent multiple confirm button actions from being triggered #565

sgregpa opened this issue Nov 18, 2022 · 0 comments

Comments

@sgregpa
Copy link

sgregpa commented Nov 18, 2022

jquery-confirm version:
v3.3.4

I'm submitting a ... (check one with "x")
[ ] bug report
[ ] feature request
[x] support request

Current behavior:

Expected behavior:
I am trying to find a way to configure a confirm dialog to only allow one button action to be processed. Currently our button action functions fire multiple times if a button is clicked multiple times before the dialog closes. In fact, in one case we have a slower action button function which makes it possible to click 2 different buttons before the dialog closes.

My hope is that I am missing something and there is a way to configure the dialog to cause all buttons to become disabled after one is clicked... or something else equivalent.

My current workaround is to use an "onAction" function as shown below for a dialog with 2 buttons (No and Yes). This seems like it would be a useful built in feature if one does not already exist.

Perhaps "disableButtonsOnAction: true/false"

Steps to reproduce:

Related code:

// current workaround idea, although the list of buttons needs to be modified for all alerts with different buttons
onAction: function (btnName) {
    this.buttons.No.disable();
    this.buttons.Yes.disable();
    console.log(btnName + ' clicked');
},

Other information:
Thank you!

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

No branches or pull requests

1 participant