You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@vonpawn Thanks so much, yes this helps. I was using autoloader and didn't think of that. Just to prevent this issue and some FOUC related problems, I decided to go back to the traditional loader. Also because I use a lot SL components it's worth the initial performance penalty.
@claviska : won't close this just yet, as it might be good to mention this in the documentation example.
Either use traditional loader or use customElements.whenDefined('sl-alert').then(() => alert.toast());
Describe the bug
The Alert component has a built-in .toast() method. I'm using the demo code from the shoelace website.
When called for the first time, it either
Uncaught TypeError: alert.toast is not a function
On the Shoelace site it all works fine, however isolating it doesn't.
To Reproduce
Steps to reproduce the behavior:
See demo
Demo
Codepen
Browser / OS
Additional information
The text was updated successfully, but these errors were encountered: