• Resolved pulpee

    (@huma11)


    Hello, the popup button works perfectly on desktop but doesn’t open when clicked on mobile, the console says SweetAlert2: “allowOutsideClick” parameter requires backdrop parameter to be set to true. How can I solve this problem ? thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pulpee

    (@huma11)

    Here’s a working turnaround by adding this code as a Snippet. Nevertheless, the error still appears in the console when the button is clicked on mobile.

    add_action('wp_enqueue_scripts', 'enqueue_sweetalert2_script');
    function enqueue_sweetalert2_script() {
    wp_enqueue_script('sweetalert2', 'https://cdn.jsdelivr.net/npm/sweetalert2@11', array(), null, true);

    wp_add_inline_script('sweetalert2', '
    const originalSwalFire = Swal.fire;

    Swal.fire = function(options) {
    if (options.allowOutsideClick && options.backdrop === undefined) {
    options.backdrop = true;
    }

    return originalSwalFire(options);
    };
    ');
    }
    Plugin Author WPBean

    (@wpbean)

    Hi,

    The backdrop parameter’s default value is true. Maybe any of your plugins or themes are also using Sweetalert2 and have changed the backdrop globally.

    However, I just added this parameter to our plugin and released an update. Please update it on your site and clear all the cache. The issue will be fixed.

    Thank you for using this plugin. If you like this plugin, please give it a 5-star rating. It will be so helpful for us.

    Have a nice day.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.