t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.39k stars 2.84k forks source link

Alert not working when full screen element is shown #898

Open gallivantor opened 5 years ago

gallivantor commented 5 years ago

Currently SweetAlert seems to attach itself to the body node of the document.

However this means that if you use the JS FullScreen API to full-screen an element (by calling element.requestFullscreen() ) and then attempt to show an alert, the alert will appear behind the full-screen element and cannot be seen.

It probably needs some logic like:

var parentElement = document.fullscreenElement || document.body;

gnzlst commented 3 years ago

Hi, use target.

swal .fire({ title: "Success!", text: "Successfully added.", type: "success", target: document.getElementById("mySpecificId"), });

SiddheshGadkar06 commented 2 years ago

Thankyou so much.. <3