Open quartertone opened 4 years ago
(Related issues: https://github.com/t4t5/sweetalert/issues/809 , https://github.com/t4t5/sweetalert/issues/893 )
This seems to be an old promblem, but I think is quite important. This bug makes SweetAlert useless as a replacement for the Window.prompt() method.
Also note that this problem seems to occur even with the official example: Try the second example under https://sweetalert.js.org/guides/#using-dom-nodes-as-content
Example code:
document.getElementById("btn").onclick = function() { swal("Test default value", { buttons: { cancel: true, ok: { value: "Button value" } }, content: { element: "input", attributes: { value: "Default value" } } }) .then((result) => { console.log(result); }); }
Expected behavior.
What happens:
(Related issues: https://github.com/t4t5/sweetalert/issues/809 , https://github.com/t4t5/sweetalert/issues/893 )
This seems to be an old promblem, but I think is quite important. This bug makes SweetAlert useless as a replacement for the Window.prompt() method.
Also note that this problem seems to occur even with the official example: Try the second example under https://sweetalert.js.org/guides/#using-dom-nodes-as-content
Example code:
Expected behavior.
What happens: