From a6e1420b2a4613eefc664dc9aed3fffb06872c38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 26 Mar 2022 12:59:43 +0100 Subject: [PATCH] Use data instead of disabled prop when clicking on button The action may actually disable the button. --- src/tab.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/tab.js b/src/tab.js index e1beaaba1d..18e8a69123 100644 --- a/src/tab.js +++ b/src/tab.js @@ -253,10 +253,16 @@ this.buttons[item.id].click(item, function(event) { var item = event.data; var button = this.buttons[item.id]; - button.prop('disabled', true); + // Use data instead of disabled prop because the action may + // actually disable the button. + if (button.data('disabled')) { + event.preventDefault(); + return; + } + button.data('disabled', true); (this[item.id](this) || jQuery.when()) .always(function() { - button.prop('disabled', false); + button.data('disabled', false); }); }.bind(this)); };