-
-
Notifications
You must be signed in to change notification settings - Fork 851
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
<sl-dialog> await hide() doesn't work in testing environment #2319
Comments
I belive await dialog.show();
await dialog.hide();
await dialog.show(); |
While creating a reproducer I figured out the await hide() before show actually works fine. Excuses! The second issue still remains though. The await hide() never resolves in a testing environment. |
Playground with multiple versions:
@BalusC – cannot reproduce the issue! |
The keyword is "testing environment". E.g. WTR/Mocha/Chai. |
What testing environment? Do you have a reproduction we could look at? |
While using of Shoelace 2.17.1 I discovered 2 issues:
1. await hide() doesn't work before a second show()The second show basically reuses the same dialog component for different content. But it gets hidden immediately basically because the animated hide isn't fully completed at that moment. I'd intuitively expect the await hide() to hook on sl-after-hide. This is therefore open for improvement.Update: Invalid. It was caused by a mistake on my side. Excuses! But the next issue still remains.
2. await hide() doesn't work in testing environment
The promise simply never resolves. I guess it's related to the headless nature of testing enrivonments. I'm using WTR with Chai/Mocha. This is probably also open for improvement. I've for now replaced it by a "sleep" of 150ms.
The text was updated successfully, but these errors were encountered: