-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Inputs and outputs don't work correctly when a modal fires too quickly after a closed modal #48
Comments
I am having a similar issue when creating an authentication interface. Basically, I ask an user for ID and password, then trigger another reactive to validate the ID & password. If the validation fails, I trigger the For example:
|
Yes this is a known issue |
The problem lies in swalservice. The way this.__swal.close is defined creates problems when you try to close and open up another sweetalert immediately. Specifically the settimeout. It's trigerring the close function after the 2nd shinyalert is already starting to initialize. initialize: function() {
var service = this;
var originalClose = this.__swal.close;
this.__swal.close = function() {
service.isClosing = true;
originalClose();
service.currentSwal = null;
setTimeout(function() {
service.onClosed();
}, 400);
};
} I can have a PR sent with this fixed but once again, this involves modifying the underlying sweetalert source. |
Related to #46
In the following example, a modal is opened, closed, and another modal with a shiny input immediately opens. The input doesn't get bound to shiny (same thing happens with outputs).
If I add a 500ms delay (either using
Sys.sleep()
orshinyjs::delay()
) after closing the first modal but before showing the second, then the input binding works.The text was updated successfully, but these errors were encountered: