Skip to content

<sl-dialog> await hide() doesn't work in testing environment #2319

@BalusC

Description

@BalusC

While using of Shoelace 2.17.1 I discovered 2 issues:

1. await hide() doesn't work before a second show()

dialog.show();
// ...
await dialog.hide();
dialog.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThings that aren't working right in the library.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions